Page 1 of 1

php displays blank page despite error reporting = On

Posted: Thu Nov 11, 2010 9:14 am
by Crayon Shin Chan
I had a Wordpress site on a Debian VPS, it was working fine with Apache and PHP, except that Apache kept on running out of RAM and getting killed. So I switched to nginx instead. NGInx requires something called php5-fpm to work with PHP. So I installed it, and it ran. But every php page now shows up completely blank. /var/log/php5-fpm.log shows nothing interesting, even when set to debug level logging. I made sure to tell NGInx to pass PHP to 127.0.0.1:9000 too:
/etc/nginx/sites-available/default
server {
        listen   80;
        server_name  localhost;

        access_log  /var/log/nginx/localhost.access.log;

        location / {
                root   /var/www;
                index  index.php index.html index.htm;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
                #proxy_pass   http://127.0.0.1;
        #}

        #pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
                include fastcgi_params;
        }

Looks OK, right? I then saw that PHP blank pages mean you need to set error reporting = On in php.ini, which is fine except that in /etc/php5, there are this many php.ini files:
server:/etc/nginx/sites-available# cd /etc/php5
server:/etc/php5# find . -name php.ini
./cli/php.ini
./fpm/php.ini
./apache2filter/php.ini
./cgi/php.ini
./apache2/php.ini

I set display_errors = On in fpm/php.ini, and in cli/php.ini, and in cgi/php.ini. Then I restarted php5-fpm. Still a blank page. Not even a simple <?php phpinfo(); ?> page works. What should I do?