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

相关推荐
晚风吹长发8 小时前
初步了解Linux中文件描述符-fd
linux·运维·服务器·c++·开发·文件
微风◝8 小时前
AlmaLinux9配置本地镜像仓库
linux·运维·服务器
保持低旋律节奏8 小时前
linux——make/Makefile自动化工程构建
linux·运维·自动化
周杰伦_Jay9 小时前
【Linux Shell】命令完全指南
linux·运维·服务器
乾元9 小时前
SDN 与 AI 协同:控制面策略自动化与策略一致性校验
运维·网络·人工智能·网络协议·华为·系统架构·ansible
锡兰_CC9 小时前
无缝触达,卓越体验:开启openEuler世界的任意门
服务器·网络·数据库·c++·图像处理·qt·nginx
wuxuanok9 小时前
ThinkPHP ——安装部署与配置
sql·mysql·nginx·php
sky北城9 小时前
Linux的回收站机制实现方式总结
linux·运维·服务器
水滴与鱼10 小时前
DOCKER制作ROS运行的镜像文件
运维·docker·容器
实心儿儿10 小时前
Linux —— 基础开发工具4
linux·运维·服务器