Resolved: Blank pages when using NginX with php-fpm

Resolved: Blank pages when using NginX with php-fpm

As of late I have been a bit busy so keeping up with updates to the web server has been pretty much neglected. Because of that I decided to switch to the nginx.org supported distribution to get the latest updates although that means a distribution without any of the extra plugins I’ve come to use. I decided this was an acceptable compromise due primarily to time issues. So pretty much there is where my problems began. I had a fully functional installation and all of a sudden after I switched distributions I got a blank screen. I tried everything: setting permissions again, monitoring the logs for errors, configuring again Nginx and PPH-FPM. Everything checked, the status pages, the ping stubs, the logs showed no errors… so this was quite the mystery. There were no indications as to what would result in blank pages being shown yet no errors on Nginx or PHP-FPM.

Fast forward a few hours later and finally I found the issue: The fastcgi.conf file was missing the definition of PATH_TRANSLATED. Apparently the previous distribution I was using had included this definition in the file but the nginx.org distribution has two fastcgi configuration files (fastcgi_params or fastcgi.conf)

and one of them is missing this definition. It was just a matter of adding the following line and you have yourself a functioning php site once again:

fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;

I hope this helps others. Seems like a really silly thing but without it PHP-FPM does not have the required configuration to be able to function properly.

You may also like...

4 Responses

  1. Thank you! Your tip was very helpful.

  2. dax says:

    That happened to me and solved my issue! thanks

  3. John Gallias says:

    This did just help me thank you so much! Got my site back up and running!
    For reference, I was upgrading from nginx 1.6.2 in the default Debian 8 jessie repositories, to 1.12 stable from the nginx.org repositories.
    I was just about to restore my DigitalOcean snapshot, when you got me back up!
    Thanks again!

  4. klindberg2007 says:

    That worked for me! After an hour or so of wading through logs, stackoverflow, etc., this was the only fix that worked. THANK YOU!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.