Dmitriy February 2016

LEMP PHP-FPM not working with nginx on ubuntu 10.04 White Screen

I have set up LEMP with the nginx server. I am able to display the html pages but not PHP. I just get an error that this page is unavailable or white blank screen. I am trying to setup wordpress on the Ubuntu 10.04 server. I'm still unable to figure out what the deal is with the php not working.

nginx configuration

server {
             listen 80;
             server_name localhost;

             root /var/www/wordpress;
             index index.php index.html index.htm;

             location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
             }

             error_page 404 /404.html;
             error_page 500 502 503 504 /50x.html;

             location = /50x.html {
                root /var/www/nginx-default;        #/usr/share/nginx/html;
             }

             location ~ \.php$ {
                #try_files $uri =404;
                #fastcgi_split_path_info ^(.+\.php)(/.+)$;
                #fastcgi_pass unix:/var/run/php5-fpm.sock;
                #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                #fastcgi_index index.php;
                #include fastcgi_params;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
              }
}

php5-fpm.log
Feb 08 14:04:01.380712 [NOTICE] fpm is running, pid 3146
Feb 08 14:04:01.387353 [NOTICE] ready to handle connections
Feb 08 14:38:43.340483 [NOTICE] Finishing ...
Feb 08 14:38:43.344984 [NOTICE] exiting, bye-bye!
Feb 08 14:38:44.388290 [NOTICE] fpm is running, pid 3334
Feb 08 14:38:44.391049 [NOTICE] ready to handle connections
Feb 08 15:03:57.966383 [NOTICE] Finishing ...
Feb 08 15:03:57.971061 [NOTICE] exiting, bye-bye!
Feb 08 15:03:59.014873 [NOTICE] fpm is running, pid 3474
Feb 08 15:03:59.018001 [NOTICE] ready to handle connections
Feb 08 15:08:16.355286 [NOTICE] Finishing ...
Feb 08 1        

Answers


user1669039 February 2016

You should be running this as a socket as well, uncomment these lines

#fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

and ensure you have chance the php fpm ini here

/etc/php5/fpm/php.ini

and ensure that it reads like

cgi.fix_pathinfo=0

restart nginx and php-fpm services.

Here is an example of my ubuntu nginx conf here>

server { listen 80;

    root /usr/share/nginx/html/wph;
    index index.php index.html index.htm;

    server_name example.com;
    charset utf-8;

    fastcgi_buffers 16 16k;
    fastcgi_buffer_size 32k;


    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
    }
    location / {

             try_files $uri $uri/ /index.php?$args;

    }
    include /usr/share/nginx/html/wph/nginx.conf;
}

server {
    listen 80;
    server_name www.example.com;
    return 301 http://example.com$request_uri;
}

Post Status

Asked in February 2016
Viewed 1,184 times
Voted 11
Answered 1 times

Search




Leave an answer