最近在新的Ubuntu 16 上配置php7 + nginx,发现访问php页面出现空白,日志中也没有错误信息,google后找到的解决办法。
参考原文:http://stackoverflow.com/questions/15423500/nginx-showing-blank-php-pages
修改站点配置信息,如下即可:
location ~ \.php$ {include /path/to/fastcgi_params;fastcgi_pass127.0.0.1:9000;# fastcgi_pass unix:/var/run/php7-fpm.sock;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME;$document_root/$fastcgi_script_name;}