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

相关推荐
小眼睛FPGA9 分钟前
【RK3568+PG2L50H开发板实验例程】Linux部分/FPGA dma_memcpy_demo 读写案例
linux·运维·科技·ai·fpga开发·gpu算力
weixin_399380692 小时前
k8s一键部署tongweb企业版7049m6(by why+lqw)
java·linux·运维·服务器·云原生·容器·kubernetes
阿巴~阿巴~2 小时前
Linux基本命令篇 —— uname命令
linux·运维·服务器
IT成长日记2 小时前
【Docker基础】Docker数据卷管理:docker volume ls及其参数详解
运维·docker·容器·volume ls
zkmall4 小时前
企业电商解决方案哪家好?ZKmall模块商城全渠道支持 + 定制化服务更省心
大数据·运维·重构·架构·开源
绝不偷吃6 小时前
ELK日志分析系统
运维·elk·jenkins
朱包林7 小时前
day45-nginx复杂跳转与https
linux·运维·服务器·网络·云计算
孙克旭_7 小时前
day045-nginx跳转功能补充与https
linux·运维·nginx·https
Hacker_Oldv9 小时前
软件测试(功能、工具、接口、性能、自动化、测开)详解
运维·自动化
Java樱木9 小时前
使用字节Trae + MCP,UI 到网页自动化。
运维·自动化