解析Linux Nginx无法解析php的方法
当用Nginx+php-fpm方式使用php的时候,如果访问php文件出现file not found的问题可以用如下方法解决
将root注释掉,并且修改fastcgi_param为SCRIPT_FILENAME $document_root$fastcgi_script_name;
location ~ .php$ {
#root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。