Typecho1.0Nginx提示accessdenied的解決辦法。

cheng061發表於2017-09-23

使用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.


相關文章