appserv: php加載apache顯示500

修改方式要注意:
希望有相關(guān)問題的人能搜到!
https://stackoverflow.com/questions/4731364/internal-error-500-apache-but-nothing-in-the-logs
Locate your php.ini file:

el@apollo:~$ locate php.ini
/etc/php5/apache2/php.ini
Edit that file as root:

sudo vi /etc/php5/apache2/php.ini
Find this line in php.ini:

display_errors = Off
Change the above line to this:

display_errors = On
Lower down in the file you'll see this:

;display_startup_errors
; Default Value: Off
; Development Value: On
; Production Value: Off

;error_reporting
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
The semicolons are comments, that means the lines don't take effect. Change those lines so they look like this:

display_startup_errors = On
; Default Value: Off
; Development Value: On
; Production Value: Off

error_reporting = E_ALL
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
What this communicates to PHP is that we want to log all these errors. Warning, there will be a large performance hit, so you don't want this enabled on production because logging takes work and work takes time, time costs money.

Restarting PHP and Apache should apply the change.

Do what you did to cause the 500 Internal Server error again, and check the log:

vi /var/log/apache2/error.log
You should see the 500 error at the end, something like this:

[Wed Dec 11 01:00:40 2013] [error] [client 192.168.11.11] PHP Fatal error:
Call to undefined function Foobar\byob\penguin\alert() in /yourproject/
your_src/symfony/Controller/MessedUpController.php on line 249, referer:
https://nuclearreactor.com/abouttoblowup

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容