使用Nginx驱动typecho,刚安装后可以看到首页却不能访问管理登录或伪静态页面,找了好多方法包括修改:/usr/local/php/etc/php-fpm.conf 在后面加上一行:security.limit_extensions = .php .asmx .html .js .css .jpg .jpeg .gif .png .htm。可是页面还不正常,按照这个blog修改了nginx配置后,问题解决。然后却发现,输入用户名密码后提示Access denied.提示cgi.fix_pathinfo应该为1,在/etc/php5/fpm/php.ini中修改完毕。最后,重启php5-fpm和nginx服务,便可以正确登录管理页面。
原文:
Finally fixed it.
The culprit was this line in my config:
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
If I commented this line, everything worked fine. However I saw this in almost every post I read about Nginx configs, so it bothered me. When looking at my configs for the millionth time, I saw that cgi.fix_pathinfo
(in php.ini
) was set to 0, where it should have been 1. The default value PHP uses is also 1, so I must have changed this in my debugging hours, because I remember reading about this value, and thought it was set correct.
Anyway, maybe it helps anyone Googling for this issue.