Php-fpm status page is not displayed

Solution 1:

I just had the same problem and I am just going to describe what i needed to make it work. You have not shared many details on your php-fpm config or your nginx (if this is what you are using as a web server). Notice you might need to run the instructions below with sudo/as root in front of the commands to have the rights to modify the files or restart services.

In php-fpm config

vi /etc/php-fpm.d/www.conf

Search for the status path directive and enable it

pm.status_path = /status

Then make sure nginx can call this location. In you nginx site config

vi /etc/nginx/conf.d/mysite.conf

Add

location ~ ^/(status|ping)$ {
     access_log off;
     #allow 127.0.0.1;
     #allow 1.2.3.4#your-ip;
     #deny all;
     include fastcgi_params;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     fastcgi_pass 127.0.0.1:9000;
 }

Notice above i have commented out the allow and deny instructions to have the status page enabled from any IP. Make sure this is not enabled on production. Now restart both nginx and php-fpm

sudo service nginx restart
sudo service php-fpm restart

Calling the status page from the browser should now work

Solution 2:

For php7.0 use these codes to enable the status.

In default file in /etc/nginx/sites-available/

location /status {
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    log_not_found off;
    }

Uncomment the following line in www.conf (file) in /etc/php/7.0/fpm/pool.d (location)

pm.status_path = /status

Restart both nginx/php7.0

sudo systemctl restart nginx
sudo systemctl restart php7.0-fpm

Now in the web browser, type this address to get a full detailed report of currently running php scripts in the currently active web server where php7.0 is configured to work.

http://yoursite.net/status?html&full

Additionally, make sure to keep it password protected in order to protect it from intruders as explained in here

https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-nginx-on-ubuntu-14-04

Tags:

Php Fpm