1 Answer
  • 1
name Punditsdkoslkdosdkoskdo

nginx showing blank PHP pages

I have setup an nginx server with php5-fpm. When I try to load the site I get a blank page with no errors. Html pages are served fine but not php. I tried turning on display_errors in php.ini but no luck. php5-fpm.log is not producing any errors and neither is nginx.


server {
    listen 80;
    root /home/mike/www/606club;
    index index.php index.html;
    error_log /var/log/nginx/error.log;
    location ~ .php$ {
            # With php5-fpm:
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;


here's my nginx error log:

2013/03/15 03:52:55 [error] 1020#0: *55 open() "/home/mike/www/606club/robots.txt" failed (2: No such file or directory), client:, server:, request: "GET /robots.txt HTTP/1.1", host: ""

For reference, I am attaching my location block for catching files with the .php extension:

location ~ .php$ {
    include /path/to/fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;

Double-check the /path/to/fastcgi-params, and make sure that it is present and readable by the nginx user.

  • 0
Reply Report