问题
ngxin,php-fpm安装后,html静态页面没问题,但是phpinfo页面虽然返回200,但总是空白页。也没有任何报错,考虑应该是nginx已经将php页面转移给php处理了,所以问题应该在php的配置上。
解决方式
经过查找,发现需要在nginx中加入一句话
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
安装完nginx后默认的fastcgi_params配置文件中没有上面这句话。
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
# With php-cgi (or other tcp sockets):
#fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
转自:csdn