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

相关推荐
BigALiang20 小时前
Linux驱动复习小记
linux·运维·服务器
2501_9464903820 小时前
Hirender MTC时间码技术实操——PH®CLUB激光投影声光电精准同步实现方案
大数据·运维·人工智能·hirender·hecoos
田里的水稻20 小时前
OE_ubuntu24.04如何安装中文简体拼音输入法
运维·前端·chrome
东北甜妹20 小时前
Rsync+sersync 数据实时同步
运维
白云偷星子20 小时前
RHCSA笔记5
linux·运维·笔记
Wpa.wk21 小时前
har文件转为接口自动化测试用例
运维·测试工具·自动化·测试用例·接口自动化
志栋智能21 小时前
自动化运维还有这样一种模式。
运维·人工智能·安全·机器人·自动化
!沧海@一粟!21 小时前
zabbix监控模板
linux·运维
巾帼前端21 小时前
全自动化知识库整理第一步
运维·自动化
麻瓜呀1 天前
vue2 Element-ui框架相关常见问题-表单组件重置显示异常
运维·服务器·ui