I always hate running server updates, something is bound to break but it’s better than being hacked I suppose. Anyway, a recent update to Ubuntu went a bit wonky or something and PhPMyadmin stopped working. This is likely something that can happen on any Linux OS so hopefully, this solution helps you out.
Whenever I tried to view PHPMyAdmin in the browser, It would return a 500 error. I checked the error logs for Apache and found the following error.
require_once(): open_basedir restriction in effect. File(/usr/share/php/Williamdes/MariaDBMySQLKBS/autoload.php)
The open_basedir restriction is a limitation that Apache can apply to a virtual host that will prevent it from being able to access files outside of specified directories. Handy if you are hacked and don’t want someone including sensitive files that the app does not need to access.
This appears to have happened with phpmyadmin was updated and the conf was replaced. I don’t remember how the initial exception to the directory made it’s way into the conf but it is gone now. The solution to this was quite simple.
Open up the PhpMyadmin Conf Or Other
Assuming you are just using the default install for phpmyadmin, you should find that it created a conf in the following directory. This may be different depending on the OS but you should have a conf somewhere with the phpmyadmin information in it.
\etc\apache2\conf-enabled\phpmyadmin.conf
Search this file for the following snippet
php_admin_value open_basedir
After this line, you will see a bunch of directory paths separated by a colon. All you gotta do is add the required include path from the original error to this list of allowed directories. So for this example, I added /usr/share/php/Williamdes/MariaDBMySQLKBS/ to the list of directories and saved the file. You may find there are some additional directories you have to add once you resolve this issue.
All you need to do now is reload the config and all is good.
#Check you havnt made a mistake anywhere before restarting apachectl configtest #If all is good, reload the config sudo systemctl reload apache2
If you check phpmyadmin again, you should be able to load it up and work away as normal. Hope this has helped. If you are still having issues, please post a comment below.
thank you this helped a lot