5

I've try to get php-fpm status page. When i open /status page in a web browser or directly to fcgi - it says File not found.

Could you help - how to fix this.

# grep -ER "status|ping" /etc/php5/* | grep -v ":;"
/etc/php5/fpm/pool.d/www.conf:pm.status_path = /status
/etc/php5/fpm/pool.d/www.conf:ping.path = /ping
/etc/php5/fpm/pool.d/www.conf:ping.response = pong 

# SCRIPT_NAME=/status SCRIPT_FILENAME=/status QUERY_STRING=  REQUEST_METHOD=GET cgi-fcgi -bind -connect /var/run/php-fpm-www.sock
Primary script unknown
Status: 404 Not Found
Content-type: text/html

File not found.

# SCRIPT_NAME=/ping SCRIPT_FILENAME=/ping REQUEST_METHOD=GET cgi-fcgi -bind -connect /var/run/php-fpm-www.sock
Primary script unknown
Status: 404 Not Found
Content-type: text/html

File not found.
12

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

5

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

-1

If you want to do this from the command line on debian.

as root

watch service php5-fpm status
  • The question was not about whether the process is running or not. – Putnik Oct 18 '16 at 8:15

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.