phpmyadmin error 500 rejected when importing database

System Error Message

Verified User
Joined
Feb 4, 2021
Messages
9
Some time ago i updated the entire php version on directadmin, tweaked php ini, improved security, made sure everything was up to date and working properly. However for a while i've been having issues whenever i try to import a database into phpmyadmin. If i copy and paste the sql commands it works fine.

In the apache error log it shows
connection to [/tmp/lshttpd/APVH_webapps_Sulsphp.sock.784] on request #0, confirmed, 1, associated process: 4373, running: 1, error: Connection reset by peer!

This happens immediately while phpmyadmin only responds back after a while with the error 500 (rejected) that connection to server was lost. Even the php settings are set to allow uploads, file sizes and other variables are fine and work fine with other websites.

I've tried rolling back the changes and it still throws the same error. I've tried checking permissions in tmp, even getting it to recreate the .sock file in tmp.
Importing the database via directadmin or mysql through command line works fine. One thing i will mention is that with the improved security, hacked websites throw an error 500 too but the error log for them just points to php files instead. i dont think phpmyadmin does anything out of the ordinary considering the same thing can be done in directadmin for importing database files.

Im out of ideas for fixing this, tried reinstalling phpmyadmin as well. On another server, running a different panel, this doesnt happen despite the increased security and the same php ini.
 
How big is the db you are trying to import?

You dont mention OS and version.

Also is all of the server updated?
 
centOS 7

Db size is very small, Kilobytes to 2MB.

Yes, i updated the whole server. well more specifically directadmin and the usual yum update. I also tweaked the settings for php and the webserver to improve security and performance and make sure that backing up works which didnt work before due to permission issues with the folder. I also changed the default php to php 7.4 and removed the rest (php 8 i will add in the future when all the extensions i need are there and tweak it in detail as the options available not in the php ini are juicy).


However the issue im having with doesnt seem to be with php, and even changing permissions on the .sock file doesnt fix it. Using the mysql command line or the directadmin database backup feature works though.
 
Try enable error/log of php in phpmyadmin and debug it. Or try increase memory_limit in "php.ini"

The error may occur due to network interruption or PHP memory limit.
 
Try enable error/log of php in phpmyadmin and debug it. Or try increase memory_limit in "php.ini"

The error may occur due to network interruption or PHP memory limit.
the memory limit is already high, network is pretty good at 5ms, no drops in network side and resource usage isnt high.
Where do i enable error log for php in phpmyadmin? i have error logging enabled in general for php but phpmyadmin sits in the main www of the webserver and i dont know where the error log for it is.
 
Code:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

Add something like this to "...www/phpmyadmin/index.php"
Maybe on other file, because it errror before/after upload cause by some function that trigger from web firewall like snuffleupagus or cause by something else


If it's me, I will go deep debugging start from upload function of phpmyadmin
 
Code:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

Add something like this to "...www/phpmyadmin/index.php"
Maybe on other file, because it errror before/after upload cause by some function that trigger from web firewall like snuffleupagus or cause by something else


If it's me, I will go deep debugging start from upload function of phpmyadmin
i tried what you said and it resulted in a blank page. i then changed the server's php ini, restarted litespeed and did not get any error, just the usual error 503 in the request waterfall.

If this were a php error it would affect other functions, but its only affecting phpmyadmin only for this function. I have tried disabling WAF and other security and it still doesnt fix the problem. From the server's own error log, it shows as trying to access a file in /tmp that exists and has the correct permissions, but it just gives the error connection reset by peer.

The first error is a 503 error in waterfall for import immediately, then later followed by a 500 error with the one i mentioned.
 
i just fixed the problem. I disabled modsecurity and uploadprogress. In the log in 1 entry i saw modsecurity pausing execution. it didnt appear in normal entries, only for the first error after restarting litespeed. Then i got error with uploadprogress so i had to disable the extension.

This is bad because modsecurity and uploadprogress are helpful.
 
Back
Top