#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:

<?php

while(1){
  $i++;
}

?>

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!!!

#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:

<?php

while(1){
  $i++;
}

?>

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!!!

#StackBounty: #16.04 #php7 How to install php http_chunked_decode on Ubuntu 16.04?

Bounty: 50

I have tried same as I did on Ubuntu 14.04.:

apt-get install -y libpcre3-dev
apt-get install -y libcurl4-gnutls-dev
printf "n" | pecl install pecl_http-3.1.0

# did not install raphf and propro because they come with pecl_http

echo "extension=http.so" > /etc/php/7.0/mods-available/http.ini
ln -s /etc/php/7.0/mods-available/http.ini /etc/php/7.0/cli/conf.d/20-http.ini
ln -s /etc/php/7.0/mods-available/http.ini /etc/php/7.0/fpm/conf.d/20-http.ini
chmod 644 /etc/php/7.0/mods-available/http.ini

echo "extension=raphf.so" > /etc/php/7.0/mods-available/raphf.ini
ln -s /etc/php/7.0/mods-available/raphf.ini /etc/php/7.0/cli/conf.d/20-raphf.ini
ln -s /etc/php/7.0/mods-available/raphf.ini /etc/php/7.0/fpm/conf.d/20-raphf.ini
chmod 644 /etc/php/7.0/mods-available/raphf.ini

echo "extension=propro.so" > /etc/php/7.0/mods-available/propro.ini
ln -s /etc/php/7.0/mods-available/propro.ini /etc/php/7.0/cli/conf.d/20-propro.ini
ln -s /etc/php/7.0/mods-available/propro.ini /etc/php/7.0/fpm/conf.d/20-propro.ini
chmod 644 /etc/php/7.0/mods-available/propro.ini

I’m getting error:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/http.so' - /usr/lib/php/20151012/http.so: cannot open shared object file: No such file or directory in Unknown on line 0

I have tried to find newer solution for installing http_chunked_decode on Ubuntu 16.04 but without success.

Thank you for help

UPDATE 1:
Also had to install:

apt-get install -y libcurl4-openssl-dev

Now I’m not getting anymore this error but function http_chunked_decode is still not working


Get this bounty!!!