遇到一个第三方后台cms安装失败的问题

tp5安装第三方的cms后台

总是遇到File not found的问题

在var/log/nginx/error.log中发现是这个错误

 [error] 3926#0: *33481 FastCGI sent in stderr: "Primary script unknown" while reading response head

 

nginx配置也找了半天,都是说什么$document_root的问题,但仔细核对后我的配置都没问题。

 

后来突然想到一点,在/etc/nginx/vhost中,对各个域名对应的文件 xx8sd9.conf

我总是习惯直接配置根目录

root /data/www/xx8sd9
导致第三方的cms系统总是找不到应该找的安装目录,
然后直接指定根目录为安装目录
root /data/www/xx8sd9/public;

问题解决,安装成功


其实第三方CMS系统,人家已提醒根目录设置为public或者install,只是自己习惯了总是在域名下,哎,

 

下面是我正确的配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
server
{
listen 80;
server_name www.xx8sd9.com xx8sd9.com;
 
root /data/www/xx8sd9/public;
index index.php index.html index.htm;
 
 
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last;
}
}
 
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
 
}

  

 

安装成功后的

 

posted @   奥雷连诺  阅读(391)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
点击右上角即可分享
微信分享提示