Php-fpm running status is not obtained through webserver

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.