8

nginx is connecting to php-fpm over fastcgi, using the standard /etc/nginx/fastcgi_params in the location block.

When connecting to /.status (php-fpm.ini::ping.path) from the command line with cgi-fcgi -bind, the result comes back as expected (X-Powered-By set, response body, etc).

When requesting with nginx, the result comes back empty (X-Powered-By set, no body length or content). nginx returns 200, since it got a "valid" response.

Watching over tcpdump, I've isolated the requests to parity in their FCGI headers (minus user-related env variables still set by the shell.)

  • Try changing to the user nginx runs as, and rerun the cgi-fcgi -bind test. – Some Linux Nerd Apr 1 '15 at 0:11
  • I always screw up NRPE deployments by testing them as root... figured you might have done the same. – Some Linux Nerd Apr 1 '15 at 0:12
10

The standard factcgi_params file doesn't contain the key line for SCRIPT_FILENAME.

location ~ \.php$ {
                include fastcgi_params;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}

Add it and restart nginx.

4

Well, your question is a bit vague. A so called “white screen of death” (WSOD) might be triggered by an endless amount of things. But some things I do if I encounter this:

  • Activate the following in your php.ini:

    display_errors = 1
    display_startup_errors = 1
    error_log = /path/to/file
    error_reporting = -1 ; (the -1 activates absolutely everything)
    log_errors = 1
    
  • Activate in your php-fpm.conf:

    error_log = /path/to/file
    
  • Activate for each php-fpm pool configuration:

    catch_workers_output = 1
    
  • Repeat your request and check all logs (incl. nginx error log)
  • Increase logging level (e.g. debug on nginx)

If nothing of this helps you to pin-down the problem then please post your complete system information and configurations. Nobody is able to give you a precise answer without that.

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.