#StackBounty: #php #php-fpm #php7 PHP slowlog empty even though PHP-FPM says it's logging

Bounty: 50

I have PHP-FPM listening on a Unix domain socket and I’ve configured the www pool (the only one present) with the following values:

slowlog = /$pool.log.slow
request_slowlog_timeout = 10s

and just for testing I’ve set max_execution_time in php.ini to 20 seconds. Then I created a test script:




Then accessed it via web browser. The script eventually times out due to max_execution_time but the log remains empty:

root@b7e4a919c988:/var/www/html# ll /www.log.slow 
-rw-rw-rw-. 1 www-data root 0 Jan  4 21:31 /www.log.slow

The PHP-FPM log, though seems to indicate that it was expecting to log the slow run:

[04-Jan-2018 21:37:28] WARNING: [pool www] child 9382, script '/var/www/html/test.php' (request: "GET /test.php") executing too slow (13.061999 sec), logging

I’ve tried a variety of things such as using sleep(10000) or putting the while loop in a function (just in case it couldn’t build a stack trace) but nothing seems to get it to print the backtrace to the log. The existence of the logfile itself also seems to indicate FPM is expecting to write slow requests.

At this point I just don’t know what else to check.

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.