时间: 1天前 人气: 2 评论: 0
有些站长说安装完V4 后台进不去
这个原因是nginx phpinfo 问题
解决方法:
打开 cscms/config/config.php
找到
$config['uri_protocol'] = 'AUTO';
改成
$config['uri_protocol'] = 'PATH_INFO';
保存。
上面 uri_protocol 为运行方法
AUTO 用于apache服务器 和 IIS
PATH_INFO 和 REQUEST_URI 用于 Nginx
对nginx的进行配置,nginx.conf(参考)
server {
listen 80;
listen [::]:80 ipv6only=on;
server_name demo.chshcms.com;
root /data/www/demo.chshcms.com;
index index.php index.html index.htm;
location / {
# 这里使用try_files进行url重写,不用rewrite了。
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .php($|/) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /.ht {
deny all;
}
}
要特别注意20行的include fastcgi_params;,如果没有这一行,那么你的PHP程序会无法运行的。我被这个坑了很多次了。