nginx解析不了php文件?
推荐学习:PHP视频教程
1、查看nginx.conf是否配置正确
正确格式:
location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;# $document_root是root指定的路径 include fastcgi_params; }
2、重载nginx配置
/usr/local/nginx/nginx -s reload
3、查看php-fpm是否启动 ps -aux |grep php
已启动:
以上是nginx解析不了php文件的详细内容。更多信息请关注PHP中文网其他相关文章!