Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

There is a PHP5.3.3 bug that won't allow me to view php-fpm's /status page via Apache2. Is there a way to manually access this data? I cannot upgrade the box (Ubuntu 10.10, php5.3.4 not supported).

I've tried connecting using the technique here: http://inode.co.nz/testing-a-fastcgi-service, but no luck.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

In order to load the /status page, you must have certain environment variables set, specifically: SCRIPT_NAME, SCRIPT_FILENAME, QUERY_STRING, and REQUEST_METHOD. You do not need DOCUMENT_ROOT (even for a normal request).

Under the correct pool (it is not a global setting) of your php-fpm config set (or uncomment):

pm.status_path = /status

Then run (replacing PORT):

SCRIPT_NAME=/status \
SCRIPT_FILENAME=/status \
QUERY_STRING= \
REQUEST_METHOD=GET \
cgi-fcgi -bind -connect 127.0.0.1:PORT

Sample Output:

X-Powered-By: PHP/5.3.9
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
Content-Type: text/plain

pool:                 web1
process manager:      dynamic
start time:           28/Jan/2012:20:49:44 -0500
start since:          5955
accepted conn:        41
listen queue:         0
max listen queue:     0
listen queue len:     128
idle processes:       1
active processes:     1
total processes:      2
max active processes: 1
max children reached: 0

Note: the results are pool specific.

Tested on a RHEL/CentOS 6 system with PHP v5.3.9.

(Side point of mention for people using CentOS - the package that provides cgi-fcgi is named fcgi and available from EPEL)

As an aside, the same can be achieved with ping:

Set: ping.path = /ping (php-fpm config)

SCRIPT_NAME=/ping\
SCRIPT_FILENAME=/ping\
REQUEST_METHOD=GET \
cgi-fcgi -bind -connect 127.0.0.1:PORT

Or for a regular PHP file (you have to use the full path, QUERY_STRING is optional):

SCRIPT_NAME=/test.php \
SCRIPT_FILENAME=/var/www/path/to/test.php \
QUERY_STRING= \
REQUEST_METHOD=GET \
cgi-fcgi -bind -connect 127.0.0.1:PORT
share|improve this answer
    
IT WORKED!!! I had tried every iteration of (REQUEST_METHOD and DOCUMENT_ROOT and (SCRIPT_NAME or SCRIPT_FILENAME)). Thank you incredibly. –  mikewaters Jan 29 '12 at 16:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.