入门客AI创业平台(我带你入门,你带我飞行)
博文笔记

解析Linux Nginx无法解析php的方法

创建时间:2016-10-17 投稿人: 浏览次数:4949

当用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;
        }


声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。