php5 php8 nginx Access denied.

服务器:nginx+php-fpm (php5.6)

有个php文件不能在 php5.6 下工作, 另安装 php8-fpm

配置:

复制代码
location ~ .*\.php8$
{
	try_files $uri =404;
	fastcgi_pass  unix:/tmp/php-cgi8.sock;
	fastcgi_index index.php;
	include fcgi.conf; break;
}

location ~ .*\.(php|php5)?$
{
	try_files $uri =404;
	fastcgi_pass  unix:/tmp/php-cgi5.6.sock;
	fastcgi_index index.php;
	include fcgi.conf;
}

浏览器打开程序,显示 Access denied. 403错误;

把原来正常工作的 .php 文件后缀改为 .php5, 也是 Access denied.

文件后缀 改成 .ph8 .8php .8ph 都是 Access denied. 四处找资料,没有找到解决办法。

把 文件名改成 .8.php 然后配置:

复制代码
location ~ .*\.8\.php$
{
	try_files $uri =404;
	fastcgi_pass  unix:/tmp/php-cgi8.sock;
	fastcgi_index index.php;
	include fcgi.conf; break;
}

浏览器打开 localhost/test.8.php 可以正常。 先能用就行,没能力找到问题根源。

相关推荐
冰封之寂27 分钟前
Docker 资源管理终极指南:CPU、内存与 IO 的精细化控制
linux·运维·服务器·docker·云计算
小柯南敲键盘1 小时前
图片翻译API接入与自动化实现指南
运维·python·自动化
云计算磊哥@2 小时前
运维开发宝典058-大型网站nginx服务器管理全集4
服务器·nginx·运维开发
952362 小时前
Docker - 基础
运维·后端·docker·容器
Promise微笑2 小时前
智能激光清障仪选型指南:高效运维与安全保障的关键考量
运维·安全
Code_Ignis3 小时前
docker国内可用源(持续维护)
运维·docker·容器
一叶龙洲3 小时前
向日葵远程Ubuntu,支持隐私屏
linux·运维·ubuntu
酷可达拉斯3 小时前
Linux操作系统-shell编程之Grep与正则表达式
linux·运维·服务器·正则表达式·centos
我星期八休息6 小时前
网络编程—UDP与TCP
linux·运维·网络·数据库·网络协议·tcp/ip·udp
Jerry小杰9 小时前
运维神器|单端口搞定多台内网SSH!frp端口复用终极教程
运维·ssh