1. 程式人生 > >FastCGI下PHP無法顯示錯誤資訊,500錯誤

FastCGI下PHP無法顯示錯誤資訊,500錯誤

在IIS+FastCGI中配置PHP後,如果php原始檔中存在錯誤,則不論是什麼錯誤,FastCGI都會返回
內部伺服器錯誤500的資訊,這給程式除錯帶來了麻煩。解決這個問題的辦法如下:

    開啟PHP的配置檔案php.ini,並做如下配置修改:
    fastcgi.logging = 0 
    log_errors = On
    error_reporting = E_ALL 
    error_log = "C:\Windows\Temp\php-errors.log"

需要確保"C:\Windows\Temp"就是系統Temp路徑,這樣以來如果是PHP元件出現錯誤,就可以在
C:\Windows\Temp\php-errors.log檔案中看到錯誤提示,如果PHP的warning或notice則在瀏覽器中

會看到詳細出錯資訊並且在php-errors.log檔案中也可以看到出錯資訊了。

不行再來幾行:
display_errors = On
html_errors = On 
見: