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

相关推荐
想唱rap3 分钟前
Linux开发工具(4)
linux·运维·服务器·开发语言·算法
weixin_537765807 分钟前
【Nginx优化】性能调优与安全配置
运维·nginx·安全
Lisonseekpan1 小时前
为什么国内禁用docker呢?
运维·docker·容器
扣脚大汉在网络1 小时前
如何在centos 中运行arm64程序
linux·运维·centos
R-G-B3 小时前
【P1】win10安装 Docker教程
运维·docker·容器
爱莉希雅&&&3 小时前
DNS分离解析案例
运维·网络·dns
jzhwolp3 小时前
从nginx角度看数据读写,阻塞和非阻塞
c语言·nginx·性能优化
Y淑滢潇潇3 小时前
RHCE Day2 时间管理服务器 NFS服务器
linux·运维·服务器
半熟的皮皮虾4 小时前
因需写了个内网运维专用的IP地址管理工具,有点不同
运维·服务器·tcp/ip
snakecy4 小时前
常用命令记录
linux·运维·github