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 可以正常。 先能用就行,没能力找到问题根源。

相关推荐
梦痕长情6 小时前
等保三级三权账户
linux·运维·服务器
jiecy7 小时前
为Linux系统双网卡配置静态路由
linux·运维
weixin_307779138 小时前
Linux下Jenkins数据故障的系统化排查Shell脚本
linux·运维·服务器·jenkins
荒--8 小时前
Burp Suite(二)
linux·运维·服务器
YangYang9YangYan8 小时前
2026自动化背景无项目经验转数据分析的可行性分析
运维·数据分析·自动化
internet Boy8 小时前
服务器机房硬件入门教程
运维·服务器
小白还菜8 小时前
linux(Debian)使用mdadm组磁盘RAID1阵列
linux·运维
三8449 小时前
BGP/BGP路由反射器/联邦/BGP属性/BGP选路
运维·服务器·网络
Lumistory9 小时前
超高层地标泛光照明落地:从方案到运维的避坑思路
运维·光照贴图
Urbano10 小时前
工装夹克、职业单西口袋工艺自动化改造深度解析
运维·自动化