nginx解析不了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
已启动: