[solution]xdebug正确配置,但不显示错误信息

一开始以为是配置问题,其实不是,折腾了好久,貌似中文网页很少有人提到这事,更别提解决之道!

最好还是用英文关键词google之:得如下网页

https://bugs.launchpad.net/ubuntu/+source/xdebug/+bug/1096464

xdebug does not display errors by default

 

Bug Description

Expected behavior:
Xdebug, when installed, should display detailed error information in the browser window.

Actual behavior:
No error details are displayed. Instead, the web server returns a 500 Internal Server Error.

Details:
The default PHP5 Apache configuration located at /etc/php5/apache2/php.ini has display_errors turned off by default. This makes sense because exposing these errors is a security risk in a production environment. This can easily be changed manually by the administrator. However, Xdebug is a tool for debugging, not for production, and its installation by the administrator implies a development/debugging environment, not production. The xdebug package should enable display_errors when it is installed.

This can be done by adding a single line to the package file installed to /etc/php5/mods-available/xdebug.ini:
display_errors = On

Upon installation, the above config file is installed into PHP's mods-available directory, and it is also symlinked to /etc/php5/conf.d/20-xdebug.ini. Thus, the configuration is loaded after php.ini and the second occurrence of display_errors overrides the first.

This simple change will allow xdebug to work as expected out-of-the-box.

 

最后手动到php.ini处修改display_errors = On

 

posted @ 2013-11-13 15:41  Mose  阅读(626)  评论(0编辑  收藏  举报