That’s because the default PHP script execution time limit is only 30s (30 seconds). Nginx By default the Nginx timeout is 60 sec. Surely you will often encounter Error 504 Gateway time-out in your browser when running / executing the php file. conf file.įor the nf file, you can add it to the http section. If you run LEMP (Linux Nginx MySQL PHP) on your server and the nginx and php configurations are still in the default configuration. You can add it to your nf file for universal use or you can customize it by adding it to your *. This can be achieved using custom config files: If you want to adjust the timeout proxy-wide, add your proxytimeout settings in a proxy-wide config. Now in the PHP section, we now turn to the Nginx section. In this parameter you can use the available units starting from s(econds) (default), m(inutes), h(ours), or d(ays). Then we enter with each favorite editor, for example:ĭan kita atur paramater request_terminate_timeout nya, contoh :īy default, these parameters will be commented with at first, delete the comment to activate. first, we look for the www.conf file with find set the request_terminate_timeout parameter and match the one we set in php.ini. Next, after finishing php.ini we move on to the The changes here have an impact on the php-fpm we run. I guess theres a danger they could both be set back to defaults in the future - but hopefully not. clientbodytimeout sendtimeout I changed both of these to 600s, restarted nginx and success Thank you. Set the max_execution_time parameter (in seconds) as needed, for example: So I searched for lines that specify 60 seconds as a timeout. If you have found it, enter using your favorite editor, for example:
#Nginx gateway timeout setting how to
I will share information on how to fix error “504 Gateway Time-out” in Nginx PHP by increasing the execution time limit of PHP scripts as follows:įor the first time we increase the execution time of the php script in the php.ini file, use find to find the location of the php.ini file. Therefore we need to increase the execution time limit of its PHP scripts. That’s because the default PHP script execution time limit is only 30s (30 seconds). For increase the timeout in Nginx upto 5 min (300 sec) add following parameters in proxyparams, sudo nano /etc/nginx/proxyparams. Surely you will often encounter Error 504 Gateway time-out in your browser when running / executing the php file. Nginx By default the Nginx timeout is 60 sec. If you run LEMP (Linux Nginx MySQL PHP) on your server and the nginx and php configurations are still in the default configuration.