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

相关推荐
门前灯32 分钟前
Linux系统之iprconfig 命令详解
linux·运维·服务器·iprconfig
忧郁的橙子.1 小时前
三、k8s 1.29 之 安装2
linux·运维·服务器
huangyuchi.1 小时前
【Linux系统】动静态库的制作
linux·运维·服务器·动态库·静态库·库的简单制作
闻不多1 小时前
用llamaindex搭建GAR遇到400
android·运维·服务器
jim写博客2 小时前
Linux进程概念(四)环境地址变量
linux·运维·服务器
是小崔啊2 小时前
【Jenkins】01 - Jenkins安装
运维·jenkins
Moment3 小时前
nginx 如何配置防止慢速攻击 🤔🤔🤔
前端·后端·nginx
Nie_Xun3 小时前
ubuntu网络共享
linux·运维·ubuntu
天上掉下来个程小白3 小时前
Docker-14.项目部署-DockerCompose
运维·docker·微服务·容器
花小璇学linux3 小时前
imx6ull-驱动开发篇22——Linux 时间管理和内核定时器
linux·运维·驱动开发