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

相关推荐
考虑考虑7 小时前
cmd局部设置java变量
运维·后端·自动化运维
生活爱好者!8 小时前
哇!影视新玩法!docker部署NEOWATCH NAS
运维·docker·容器
一技安身8 小时前
【信创】银河麒麟V10、统信UOS解压7Z文件
linux·运维·服务器
迷途呀9 小时前
CI/CD 自动化部署实践:让代码提交后自动上线
linux·运维·nginx·ci/cd·自动化
闲云自留地9 小时前
动手玩 Nova:Hypervisor、主机聚合、可用分区、虚拟机生命周期实操
运维·架构·openstack
binqian10 小时前
【linux】OpenSSH升级文档
linux·运维·网络
吴声子夜歌10 小时前
Shell编程——if条件语句
linux·运维·shell
和裕10 小时前
蜂窝板 vs 七层瓦楞重型纸箱:大件工业设备运输性能与成本全对比
大数据·运维·网络·人工智能·算法
Dawn-bit10 小时前
Linux 运维基础扩展:跳板机、堡垒机与物理服务器全流程
linux·运维·服务器·云计算·运维开发
新时代牛马10 小时前
Linux 定时任务:crontab、anacron 与systemd timer
linux·运维·服务器