linux nginx不解析php怎么办
2022-12-02 09:01:16
194
{{single.collect_count}}

linux nginx不解析php的解决办法:1、查询9000端口是否出于侦听状态;2、查看“php-fpm.conf”文件;3、修改nginx配置为“location ~ \.php$ {fastcgi_pass unix:/dev/shm/php-cgi.sock;#127.0.0.1:9000 fastcgi_indexindex...”即可。

Linux系统运维及项目正式上线:进入学习

本教程操作环境:linux7.3系统、PHP8.1版、Dell G3电脑。

linux nginx不解析php怎么办?

nginx 不解析php文件 502的解决办法:

安装的nginx默认侦听的是9000端口

查询9000端口是否出于侦听状态

netstat -antp | grep :9000
登录后复制

查询之后发现没有查到,查看php-fpm.conf文件

cat /usr/local/php/etc/php-fpm.conf
登录后复制

修改nginx配置

location ~ \.php$ {fastcgi_pass unix:/dev/shm/php-cgi.sock;#127.0.0.1:9000fastcgi_indexindex.php;fastcgi_paramSCRIPT_FILENAME $document_root$fastcgi_script_name;includefastcgi_params;}
登录后复制

推荐学习:《PHP视频教程

以上就是linux nginx不解析php怎么办的详细内容,更多请关注php中文网其它相关文章!

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}