PhpMyAdmin allows easy editing of website databases.
But, at times due to missing server modules or wrong permissions, PhpMyAdmin error 500 shows up. PhpMyAdmin will work only after fixing the real problem.
That’s why, we often get requests from customers to fix PhpMyAdmin errors as part of our Technical Support Services.
Today, we’ll see the reasons that cause PhpMyAdmin error 500 and how we fix them.
Why to use PhpMyAdmin?
In internet, a major share of websites work based on the underlying databases. Therefore, website owners often need to modify databases as part of the website management. Unfortunately, managing databases via command line can be a tedious task. That’s where editing databases via PhpMyAdmin helps.
PhpMyAdmin is nothing but a tool that helps to create, manage databases from the browser. Usually, it is secured by a username and password.
Editing database is rather simple in PhpMyAdmin. Obviously, it’s a solution that our Dedicated Engineers often suggest to customers for quick database edits. But, trouble comes when it report errors.
Reasons for error 500 in PhpMyAdmin
From our experience in managing servers, we often see errors with PhpMyAdmin at various stages. It can shows 500 errors while installation or even when users access it to modify databases.
Now, let’s see the main reasons for PhpMyAdmin error 500.
1. Missing dependency modules
PhpMyAdmin utility depends largely on certain PHP modules like php-mbstring, php-gettext, etc. Unfortunately, these modules do not come across with many standard PHP packages.
When doing a fresh installation of PhpMyAdmin, the setup will create all the required PhpMyAdmin files. But, if these related modules are missing on the server, accessing PhpMyAdmin reports “500 Internal Server Error” status code. At times, it can be even a blank page.
2. Wrong permissions
Similarly, wrong permissions of php files can also be a reason for PhpMyAdmin errors. For example, in cPanel servers, wrong permission on the files like /usr/local/cpanel/3rdparty/bin/php, /usr/local/cpanel/3rdparty/bin/php-cgi create problems with PhpMyAdmin. Any permission other than 755 will cause PhpMyAdmin to stop working.
3. PHP configuration limits
Yet another common reason for internal server error in PhpMyAdmin can be PHP limits set in the server. For security reasons, PHP limits the maximum resources a PHP process can use on the server. If any process cross these limits like memory_limit, max_input_vars, etc. it results in the error as shown.
How we fix PhpMyAdmin internal server error?
Till now we saw the top 3 reasons that can result in internal server error in PhpMyAdmin. The solution depends on the root cause for the error. We’ll now check how our Support Engineers fix each of them.
1. Missing modules
Recently, one of customers was getting 500 error during PhpMyAdmin installation on one of his domains. His Ubuntu server had Apache2.4 and PHP 7. When tried to open PhpMyAdmin for the first time, it reported internal server error.
On detailed troubleshooting, our Dedicated Engineers found that couple of PHP modules were missing on the server. Therefore, we installed the missing modules using:
apt-get install php-mbstring php7.0-mbstring php-gettext
Then we restarted Apache, and PhpMyAdmin started working fine.
2. Fixing permissions
In many cases, fixing permissions will solve the PhpMyAdmin error 500. Here, we check the php binary files and set them with 755 permissions.
Recently, when a Plesk customer attempted to make a change to a database field in phpMyAdmin, the system crashed with 500 Internal Server Error.
Our Support Engineers saw the following records on /var/log/sw-cp-server/error_log file:
*1110 open() "/var/lib/sw-cp-server/body/0000000014" failed (13: Permission denied), client:, server: , request: "POST /domains/databases/phpMyAdmin/import.php HTTP/1.1"
Here, the problem happened due to wrong ownership for /var/lib/sw-cp-server/ directory. Therefore, we fixed it by setting correct ownership and permission on the directory using:
chown sw-cp-server:sw-cp-server /var/lib/sw-cp-server/ chmod 700 /var/lib/sw-cp-server/
3. Setting proper PHP limits
For trouble caused by PHP limits, there will be related entries in the web server log files. Therefore, to fix PhpMyAdmin errors, our Support Engineers always check the log files as the initial step.
For example, when customer tried to open a large table via phpMyAdmin the following error displayed in the logs.
[29-Mar-2019 12:49:10] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 401128 bytes) in /opt/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/DisplayResults.php on line 2852
Obviously, from the error log, we could identify that insufficient PHP memory limit was causing the error. Therefore, the fix was to set proper values in the correct php.ini file, followed by a web server restart. The customer was having a Plesk server. So we increased the memory_limit, max_input_vars parameters in the file /usr/local/psa/admin/conf/php.ini.
In cPanel servers, each version of PHP on the server uses its own
php.ini file. In such cases, our Dedicated Engineers ensure that we set the limits in the correct php.ini file used by the domain.
[Getting internal server error on PhpMyAdmin? We are here to fix it.]
In a nutshell, PhpMyAdmin error 500 shows up due to missing server modules, wrong permissions, PHP limits and so on. Today, we discussed these reasons in detail and how our Dedicated Engineers fix them and make PhpMyAdmin working.