You can configure a pm. status_path such as '/status' without obtaining the php-fpm running status through webserver, and then access this address through web server to obtain the running status. However, this will intrude the web server configuration. it is not convenient to monitor the status of each backend separately if multiple php-fpm instances exist on the backend of a web server. to ensure security, you must configure access control.
Fortunately, there is a ready-made cgi-fcgi tool that can wrap fcgi requests into cgi methods so that fastcgi can be called directly in the command line.
Cgi-fcgi can be installed using 'yum install fcgi 'in redhat/centos, and 'Apt-get install libfcgi-Dev' in ubuntu.
You can use the following methods to obtain the php-fpm status.
Path =/statusexport REQUEST_METHOD = GETexport SCRIPT_NAME = "$ path" export SCRIPT_FILENAME = "$ path" export QUERY_STRING = ''# export QUERY_STRING = 'full' # export QUERY_STRING = 'json '# export QUERY_STRING = 'full & XML' addr =/var/run/php-fpm.socket # addr = 127.0.0.1: 9000cgi-fcgi-bind-connect "$ addr"
When QUERY_STRING is set to full, the status of each worker process is displayed. You can add json, xml, and html to display results in different formats.