https://www.cdsy.xyz/computer/servers/Nginx/230611/cd44163.html
yum install -y php-fpm
编缉Nginx配置文件(/usr/local/nginx/conf/nginx.conf),找到FastCGI段取消注释并改成合适自己的值:
nginx默认根目录为/usr/local/nginx/html(可通过修改root的值来改变),我们到此目录下生成phpinfo.php
cat > phpinfo.php << EOF
<?php
phpinfo();
?>
EOF
php-fpm
nginx
报错“File not found”,到/usr/local/nginx/logs/error.log查看具体报错信息为FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream
根据网上说法,是nginx.conf配置的反向代理中无法识别/scripts要改成$document_root,具体原因未探究先跟着改就行
然后重新加载nginx配置,再查次访问phpinfo.php页面:
nginx -s reload