Bobcares

DirectAdmin PhpMyAdmin error 500 – How to fix it

by | Apr 29, 2021

While accessing PhpMyAdmin from DirectAdmin panel, users often receive a 500 error.

As a part of our Server Management Services, our Support Engineers helps to fix similar DirectAdmin-related errors regularly.

Let us today discuss the possible reasons and fixes for this error.

What causes DirectAdmin PhpMyAdmin error 500

PhpMyAdmin at times returns the error as given below while accessing it from DirectAdmin. A typical error message looks like the one below:

DirectAdmin PhpMyAdmin error 500

Though it shows the error while accessing PhpMyadmin, MySQL would be running fine on the server. Also, users would be able to create and delete databases via DirectAdmin control panel.

Some of the top reasons for this error include:

  1. ini_set function is present in the disabled functions.
  2. Mod_security rule is triggered.
  3. Request exceeded the limit of 10 internal redirects due to probable configuration error.
  4. Check for any conflicting PHP extensions

 

How to fix DirectAdmin PhpMyAdmin error 500

Before we get into the steps to fix the PhpMyAdmin error, it is important to collect the details of the errors in the logs. Our Support Engineers cross-check the apache error log initially for errors. This can be in /var/log/httpd/error_log or /var/log/httpd/domains/domain.com.error.log.

Next, they turn on “display_errors” in config.php file under phpmyadmin folder.

1. Remove ini_set function from disable_functions in php.ini

By default, each server has a set of functions declared in the disabled functions list in php.ini. This feature is to disable the execution of dangerous functions in the server.

For instance, Our Engineers have noticed a few of these cases where the ini_set function is disabled in the php.ini file and it triggers the error with PHPMyAdmin. Removing it from the disable_function list fixes the issue.

2. Modsecurity Rules

Another common reason for this error would be ModSecurity rule. By default custombuild installation, mod_security rules are installed in /etc/modsecurity.d/

Apache load’s ModSecurity modules and configuration in/etc/httpd/conf/extra/httpd-modsecurity.conf.

In reality, the easiest way to disable Modsecurity is to disable apache to load ModSecurity module in https-modsecurity.conf file. Just add #comment’s to begin LoadModule directive:

httpd-modsecurity.conf
LoadFile /usr/local/lib/libxml2.so
#LoadModule security2_module /usr/lib/apache/mod_security2.so
<ifmodule mod_security2.c>
# Default recommended configuration
SecRuleEngine On
SecRequestBodyAccess On
.
.
.
</ifmodule>

Another method if we want to keep ModSecurity module loaded to apache is change SecRuleEngine to Off as given below

SecRuleEngine Off

Then restart the web service.

3. Update and rebuild DirectAdmin

Sometimes, updating and rebuilding DirectAdmin fixes this error with the PHPMyAdmin. This can be done with the series commands below:

cd /usr/local/directadmin/custombuild
./build update
./build set use_hostname_for_alias no
./build rewrite_confs

 

4. Disable conflicting PHP extensions.

Often, the PHPMyAdmin error could also be related to some PHP extensions. For instance, we recently handled a support request where the uploadprogress extension was triggering the error.

To disable a php extension in DirectAdmin follow the series of steps below:

  • Log in to your server via SSH.
  • Change directory to custombuild and run an update.
    cd /usr/local/directadmin/custombuild
    ./build update 
    ./build set_php extension_name no

We can verify the extensions either by using command “php -m” from command line or by using php.info page.

[Need any further assistance in fixing DirectAdmin errors? – We’re available 24*7]

Conclusion

In short, the PhpMyAdmin error 500 triggers due to a number of reasons that include PHP settings, modsecurity rules etc. Today, we saw how our Support Engineers fix them.

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.