PHP5-FPM and Nginx White Screen

Ain’t nobody got time fo dat.

Ah, the infamous white screen of death. After doing some server and package upgrades, I ran across the problem of a blank screen being generated when trying to access the websites located on the server. None of the configuration files were changed, I had simply upgraded some packages and kept my settings intact. After checking Nginx’s access logs, it showed an HTTP status of 200 OK, which is good. So with Nginx not being the problem, I decided to check out PHP-FPM. Everything seemed good on that end as well.

After doing some digging and a bunch of Googling, I managed to find out I hadn’t ever set the SCRIPT_FILENAME param in a conf file. It seems to be defined in the fastcgi.conf file, but the file that’s being used is called fastcgi_params, which doesn’t include this line. Add the below line to that file or to your location ~ \.php$ directive and you should be good to go.

	fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

And just for reference, this is what my location directive looks like:

	location ~ \.php$ {
		try_files $uri =404;
		fastcgi_pass unix:/var/run/php5-fpm.socket;
		fastcgi_index index.php;
		include fastcgi_params;