Disable HTML stack traces by Xdebug

夙愿已清 提交于 2019-11-27 15:56:14

问题


The administrator has installed Xdebug 2.1.1 in our shared PHP 5.3.0 server in order to use its debugger. Now, I can hardly read the stack traces of uncatched exceptions because they are formatted by Xdebug with annoying colours that interact badly with the site's CSS:

Since PHP runs as Apache module, I've tried to disable this feature in an .htaccess file but I can't make it go:

php_flag xdebug.default_enable Off
php_flag xdebug.overload_var_dump Off
php_flag xdebug.show_exception_trace Off
php_value xdebug.trace_format 1

phpinfo() shows my changes in the Local Value column but I can still see those horrible orange tables. What's the directive I need to change?


回答1:


Check for xdebug_disable()Docs:

Disables stack traces

Disable showing stack traces on error conditions.

See as well xdebug.default_enableDocs.




回答2:


You need to make sure you have html_errors=0 in PHP as well. Also, orange isn't horrible ;-)




回答3:


Add following code in the initialization Script:

 if (function_exists('xdebug_disable')) {
           xdebug_disable();
         }


来源:https://stackoverflow.com/questions/6911897/disable-html-stack-traces-by-xdebug

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!