当前位置:首页 > 服务器技术 > nginx

nginx不能解析php

nginx不能解析php - 文章图片

首先先安装php-fpm

yum install php-fpm
service php-fpm start    #启动 php-fpm

然后修改nginx配置文件nginx.conf 识别php

vi /usr/local/nginx/conf/nginx.conf 加一段代码

location ~ .php$ {
   #fastcgi_split_path_info ^(.+.php)(/.+)$;
            root          /usr/share/nginx/html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
            include        fastcgi_params;
#$document_root
        }

最后重启nginx和php-fpm

service nginx restart
service php-fpm restart

推荐教程:PHP视频教程

以上就是nginx不能解析php的详细内容,更多请关注Gxl网其它相关文章!


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!