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 分钟前
Linux --systemctl损坏
linux·运维·服务器
南方以南_12 分钟前
【云实验】搭建个人网盘实验
linux·运维·服务器
humors22113 分钟前
Windows运维工具批处理版
运维·windows·计算机·电脑·笔记本·维护·台式机
xbd_zc1 小时前
【Linux Nano Vim快捷键大全】
linux·运维·vim
Mapleay1 小时前
ubuntu 更新华为源
运维·服务器·ubuntu
shane-u2 小时前
Dockerfile实战:从零构建自定义CentOS镜像
linux·运维·centos
孙克旭_2 小时前
day016-系统负载压力测试-磁盘管理
linux·运维·压力测试
qq_454175793 小时前
gcc/g++常用参数
linux·运维·服务器
sun0077004 小时前
windows 10 做服务器 其他电脑无法访问,怎么回事?
运维·服务器·网络
wb1894 小时前
Linux远程连接服务
linux·运维·服务器·笔记