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 disp
The reason this problem occurs is because the fastcgi configurations in nginx do not function as required and in place or processing, they respond as html data. There are two possible ways in which you can configure your nginx to avoid this problem.
Method 1:
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# With php5-fpm:
fastcgi_pass unix:/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
Method 2:
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include snippets/fastcgi-php.conf;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
}
Both the methods would work properly, you can go ahead and take any one of them. They almost perform the same operations with a very few difference.