How to increase the timeouts when using Nginx, PHP-FPM and phpMyAdmin

Today I needed to change some tables’ structures using phpMyAdmin.

To my surprise not long after I clicked Go to execute the queries, many errors started comming from nginx and php.

So I started looking around about any timeout settings I can use in nginx and php5-fpm and the final working result is this (I choose a timeout of 600 seconds):

/etc/php5/fpm/php.ini

max_execution_time = 600

/etc/php5/fpm/pool.d/www.conf

request_terminate_timeout = 600

in nginx conf of my site inside the *.php location settings:

fastcgi_read_timeout 600;

reload/restart your php and nginx servers for the new changes to take effect and you are ready. Test it by executing some queries that you know will take more time than usual.

Here’s a good source and more settings and information.

If you’re going to change the nginx and php settings of the servers running inside Docker containers you better use this syntax:

servername reload

instead of:

servername restart

Or your container may be automatically stopped after the restart is executes as the restart command is just short for: stop->start.

Cloudflare:

if you’re using phpMyadmin behind Cloudflare, check their thoughts about that: https://support.cloudflare.com/hc/en-us/articles/200171926-Error-524

Converting Mongoose model functions to be Promise and callback friendly simultaneously

I just started using promises in one of my Node.js applications after watching the callback ...

Learn more

About Iliyan Trifonov

Web Developer, Blogger
Tagged , , , , , . Bookmark the permalink.