Can’t Load PhpMyadmin On After Server Update

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.

 

Related Articles

Related Questions

Could My GPU and Monitor Have Been Damaged by a Chewed PSU Cable?

Hey everyone! I'm in a bit of a bind here and could use some help. I recently discovered that my rabbit chewed on my...

How Can I Save Money on My PC Build Without Losing Performance?

Hi everyone! I've been diving into PC building and came up with a setup that fits my gaming needs. However, I've noticed that my...

When Should You Refactor vs. Rewrite Your Code?

Hey everyone! I've been grappling with the decision on whether to refactor some existing code or to just rewrite certain parts from scratch. Each...

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Tools

Online Hash Generator – String to Hash Converter

Need to quickly generate a hash from a string? Whether you're verifying file integrity, securing data, or just experimenting with cryptographic tools, this simple...

Convert CSV To HTML Table

Need to quickly turn CSV data into an HTML table? Whether you're copying data from Excel, Google Sheets, or another spreadsheet, this tool makes...

Student Group Randomizer

Creating fair and balanced groups in the classroom can be time-consuming — especially when you're trying to avoid repetition, manage different skill levels, or...

Random Group Generator

Need to split a list of people, items, or ideas into random groups? Our free Random Group Generator makes it quick and easy. Whether...

Flip Text Upside Down – Free Online Tool

Ever wanted to flip your text upside down just for fun or to grab someone’s attention in a creative way? This free online Upside...

Raffle Ticket Generator

If you're running a fundraiser, charity draw, or local event and need raffle tickets fast, this free online tool lets you generate and print...

Latest Posts

Latest Questions