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.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
require_once(): open_basedir restriction in effect. File(/usr/share/php/Williamdes/MariaDBMySQLKBS/autoload.php)
require_once(): open_basedir restriction in effect. File(/usr/share/php/Williamdes/MariaDBMySQLKBS/autoload.php)
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.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
\etc\apache2\conf-enabled\phpmyadmin.conf
\etc\apache2\conf-enabled\phpmyadmin.conf
\etc\apache2\conf-enabled\phpmyadmin.conf

Search this file for the following snippet

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
php_admin_value open_basedir
php_admin_value open_basedir
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.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#Check you havnt made a mistake anywhere before restarting
apachectl configtest
#If all is good, reload the config
sudo systemctl reload apache2
#Check you havnt made a mistake anywhere before restarting apachectl configtest #If all is good, reload the config sudo systemctl reload apache2
#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

What’s the Best Way to Start Learning Crypto Coding?

Hey everyone! I'm totally new to coding and I'm really eager to learn. I recently watched a video that mentioned picking a specific area...

Looking for Guidance to Transition from Front-End to Full-Stack Development

Hey everyone! I've been working as a front-end developer for over five years, primarily with React. Lately, I've been feeling a bit stuck, especially...

Help! My Old Employer Changed My Apple ID After I Quit

I made a mistake by using my personal Apple ID on my work Mac, and now I'm in a bit of a jam. When...

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

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...

Random Number Generator – Create Multiple Random Numbers Instantly

Welcome to our free, browser-based Random Number Generator – a fast and flexible tool designed to help you generate as many random numbers as...

Instant Online Dice Roller

Need a quick, trustworthy way to roll dice without digging through a board‑game box or cluttering your desk? Our free online dice roller is...

Docx To PDF

Need to turn a Word document into a fully‑formatted PDF—without installing software or handing over your email address? Our free DOCX‑to‑PDF converter does exactly...

xAI Grok Token Calculator

This tool is a simple xAI Grok token calculator that helps you estimate the number of tokens your input text might consume when working...

DeepSeek Token Calculator

This tool is a straightforward DeepSeek token calculator, created to help you estimate how many tokens your text may use when working with DeepSeek...

Latest Posts

Latest Questions