$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>NGINXWordpress Site - Increasing php.ini max_execution_time = 600 doesn't work|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

NGINXWordpress Site - Increasing php.ini max_execution_time = 600 doesn't work

matteradmin11PV0评论

I'm testing my PHP Limit on WordPress site and keep getting a 504 Gateway Time-out.

I'm changing the max_execution_time in php.ini to reflect the value of 600.

Followed by restart when I test the PHP Limit it gives me a 504 Gateway Time-out.

Upon checking php -i I get the following result; max_execution_time => 0 => 0

the ini file is pointing at /etc/php/7.0/cli and this is the one I am configuring.

Contacting support they have stated;

That command checks the overall php ini settings, not for the application. The bad gateway error may be because of an error in the configuration setup. Try verifying the configuration file and checking your error logs.

Checking contents for error log, nothing recorded.

I'm testing my PHP Limit on WordPress site and keep getting a 504 Gateway Time-out.

I'm changing the max_execution_time in php.ini to reflect the value of 600.

Followed by restart when I test the PHP Limit it gives me a 504 Gateway Time-out.

Upon checking php -i I get the following result; max_execution_time => 0 => 0

the ini file is pointing at /etc/php/7.0/cli and this is the one I am configuring.

Contacting support they have stated;

That command checks the overall php ini settings, not for the application. The bad gateway error may be because of an error in the configuration setup. Try verifying the configuration file and checking your error logs.

Checking contents for error log, nothing recorded.

Share Improve this question edited Mar 5, 2019 at 15:31 Christine Cooper 8,8977 gold badges60 silver badges93 bronze badges asked Mar 4, 2019 at 1:00 Spizza85Spizza85 1
Add a comment  | 

1 Answer 1

Reset to default 2

There are basically 3 sets of timeouts when dealing with simple NGINX + PHP-FPM stack.

One is PHP engine, which you have already adjusted to unlimited.

Second is PHP-FPM, which is controlled via request_terminate_timeout in your pool settings. The default is usually like this:

;request_terminate_timeout = 0

Value of 0 would mean that there is no limit set by PHP-FPM itself, so you likely won't have to adjust that.

Finally, there are NGINX timeouts for FastCGI communication, which are controlled through a couple of directives in your NGINX config. You mostly care about fastcgi_read_timeout:

If the FastCGI server does not transmit anything within this time, the connection is closed.

You would place it in your PHP handler location, e.g.:

location ~ \.php$ {
    ...
    fastcgi_connect_timeout 600s;
    fastcgi_pass ...;

P.S. Don't confuse "Bad Gateway" (502) and "Gateway Time-out" (504) errors. Those are different errors: the former is for a failure to communicate with PHP-FPM (typically a sign of severe misconfiguration, defunct / not running PHP-FPM process), while the latter is exceeding timeout while communicating with PHP-FPM.

Post a comment

comment list (0)

  1. No comments so far