Last Updated: February 25, 2016
·
3.789K
· patschi

Linux: get socket-status (php5-fpm) via linux command

It's easy to get the status of the current php5-fpm socket through an webserver. But I needed a solution to get the status directly with a linux command.

The solution was quite easy. Just two variables and one command:
export SCRIPTFILENAME=/fpm-status; export SCRIPTNAME=/fpm-status; cgi-fcgi -bind -connect /etc/php5/fpm/sockets/www.socket

Just be sure, you added the correct line in the socket-conf:
pm.status_path = /fpm-status

The output looks like that one:
Picture

A nice shell script you can find here:
http://lumux.co.uk/2012/08/02/php-fpm-status-stats-without-a-webserver/

Orginally posted on my german homepage:
http://pkern.at/1649/linux-status-eines-unix-sockets-von-php5-fpm-abrufen-ohne-webserver :)