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

相关推荐
EMTime8 小时前
Docker运行OpenWRT
运维·docker·容器
lolo大魔王8 小时前
Linux 文件系统超全面详解(原理、结构、挂载、分区、inode、日志、管理命令)
linux·运维·服务器
zyl8372110 小时前
Docker 使用手册
运维·docker·容器
古月方枘Fry11 小时前
MGRE实验
运维·服务器
stolentime11 小时前
FreeDomain 本地开发环境快速搭建指南
运维·服务器·网络
bush413 小时前
嵌入式linux学习记录四
linux·运维·学习
lihao lihao14 小时前
软硬链接
linux·运维·服务器
TOWE technology14 小时前
智能安防监控系统如何做好防雷?——视频信号SPD综合应用方案解析
运维·服务器·防雷产品·信号保护·信号防雷·spd
楼田莉子14 小时前
Docker学习:Docker介绍及其架构介绍
运维·后端·学习·docker·容器·架构
大明者省15 小时前
IIS 端口绑定正常访问的原理说明与常见误区澄清
运维·服务器·笔记