Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nginx showing blank PHP pages

Tags:

php

nginx

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.

nginx.conf

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

EDIT

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: 199.30.20.40, server: mikeglaz.com, request: "GET /robots.txt HTTP/1.1", host: "mikeglaz.com" 
like image 944
Mike Glaz Avatar asked Mar 15 '13 02:03

Mike Glaz


People also ask

Why PHP page is blank?

The most common reason for a blank page is that the script is missing a character. If you left out a ' or } or ; somewhere, your PHP won't work. You don't get an error; you just get a blank screen.

What is PHP-FPM in nginx?

PHP-FPM (FastCGI Process Manager) is an alternative to FastCGI implementation of PHP with some additional features useful for sites with high traffic. It is the preferred method of processing PHP pages with NGINX and is faster than traditional CGI based methods such as SUPHP or mod_php for running a PHP script.


1 Answers

replace

include fastcgi_params; 

with

include fastcgi.conf; 

and remove fastcgi_param SCRIPT_FILENAME ... in nginx.conf

like image 179
spacepille Avatar answered Sep 24 '22 17:09

spacepille