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

相关推荐
君穆南4 小时前
基于 NFS 与 Rsync 实现跨服务器 Seafile 数据平滑迁移实战
linux·运维·git
bloglin999994 小时前
scp、rsync远程文件同步
linux·运维·服务器
迦南的迦 亚索的索4 小时前
LINUX环境
linux·运维·服务器
yuanjj884 小时前
linux下调试域格CLM920 NC5等9x07平台模块 QMI拨号
linux·运维·服务器
IMPYLH4 小时前
Linux 的 printenv 命令
linux·运维·服务器·bash
SilentSamsara4 小时前
SSH 远程管理:密钥登录 + 隧道转发,一次性配置好
linux·运维·服务器·ubuntu·centos·ssh
Cx330❀6 小时前
Linux命名管道(FIFO)通信:从原理到实操,一文搞懂跨进程通信
大数据·linux·运维·服务器·elasticsearch·搜索引擎
嵌入式×边缘AI:打怪升级日志6 小时前
嵌入式Linux应用开发快速入门(从零到第一个程序)
linux·运维·notepad++
AI、少年郎6 小时前
MiniMind第 2 篇:破除大模型 “神秘感“, 环境搭建|Win/Linux 本地快速部署
linux·运维·服务器·ai·大模型训练·大模型微调·大模型原理
乐维_lwops7 小时前
五层架构全景解析:Lerwee 运维智能体如何实现 “从感知到行动”(二)
运维·架构·运维智能体