PhpMyAdmin 504 Gateway Timeout error when importing Database

I am aware, that there are similar topics on this forum already, but unfortunately this issue never got solved.

When uploading a 6MB zip packed sql database i get an timeout error. apache and php settings are set to handle fileuploads much larger than this. (unpacked database is 180MB)

I would like to use hestia because it is a graphical tool to manage servers, so using the CLI to get things done is a workaround, but not really a solution.

does anyone know why this timeout happens so it can be properly fixed?

PHP execution times.

Faster CPU
Increase timeouts
Split SQL into different chunks

Well, yes, but i see an irregularity of software behavior on the very same server.

Running the exact same import on Webinoly, AAPanel, or CyberPanel, will just work. Even with the same timeout settings in PHP (standard execution time 30s)

Looking at the overall workload, it only takes 5 seconds for the CPU to process the import.
4x 2,5 Ghz is enough for such an easy task, even if PHP only uses 1 CPU for execution.

Hence i believe there is another underlying issue here.

Then we can’t help you if you don’t provide debug information.

I encountered a similar issue doing debugging. A possible useful suggestion (as opposed to getting a “Faster CPU”), would be to increase the Apache and Nginx timeout values. Unlike HestiaCP, those other panels that “will just work” use the default of 300 seconds where as the default install of HestiaCP I recently installed is set to a ridiculously low 30 seconds (in /etc/apache2/apache2.conf); that’s NOT the documented default apache is normally set to (see core - Apache HTTP Server Version 2.2).

You can either create new templates for Apache, and Nginx and set the following values:

  • For Apache, after the <VirtualHost %ip%:%web_ssl_port%> definition
TimeOut 600
  • For Nginx, at the bottom of the file before the ending }
fastcgi_read_timeout 600s;

Remember that if you modify the existing Hestia files they will be overwritten at update. Instead, copy the template files at /usr/local/hestia/data/templates and select them for your given site.

Modifying both Apache and Nginx helped resolve the 504 timeout error I encountered.

Cheers!

I ran into this problem last week when trying to move a very large website to a new domain name and blank database. No amount of increase time outs or increasing php.ini file upload limits worked with PHP my Admin. What finally worked for me for a file that was 300 MB was to first increase the php.ini max upload setting to more than 300 MB. Then use the Hestia User file manager to load the sql file into the tmp folder. Then SSh into the server as root and use midnight commander to transfer the sql file to the new database. Then change the paths in the configuration file. Logged into PHP my admin and there was the database! Problem solved. Dang that PHP my admin anyway.

Please use for larger files command line it goes way faster…

1 Like

Use command line interface: mysqldump command

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.