My website is running successfully on PHP-FPM with NGINX on Debian. Timeout period is set at 300 seconds for NGINX. This is enough for most pages, but some scripts get stuck. I can't reproduce the issue in testing, so I would like to know where the script is stuck. Can PHP-FPM report the last line number when a time out occurs?


You can enable the php-fpm slow log. If a request takes more than a configurable amount of time, php-fpm will dump a stack trace to a log file.

An example configuration, which goes into your php-fpm pool configuration file:

slowlog = /var/log/php5/slow.log
request_slowlog_timeout = 5s

In this case, any request that takes more than 5 seconds of wall clock time will get a stack dump into /var/log/php5/slow.log.

Note that the request will continue running.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.