xdebug影响php运行速度

时间:2023-03-09 14:41:34
xdebug影响php运行速度

我在本地wamp的环境下面加了xdebug用来调试,但是我发现wordpress运行速度好慢,所有程序运行变得也很慢。开始以为是数据库有问题,找了半天,发现把xdebug的扩展去掉,就正常了。

目前配置:

[Xdebug]
;zend_extension="ext/php_xdebug-2.3.3-5.4-vc9-nts.dll"
;xdebug.var_display_max_children=
;xdebug.var_display_max_data=
xdebug.var_display_max_depth=
xdebug.max_nesting_level= xdebug.auto_trace= "On"
xdebug.collect_params= "On"
xdebug.collect_return= "On"
xdebug.trace_output_dir="xdebug/trace"
xdebug.profiler_enable= "true"
xdebug.profiler_output_dir="xdebug/profiler"
xdebug.profiler_append =
xdebug.profiler_enable_trigger =
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable= "On"
xdebug.remote_autostart = "On"
xdebug.remote_host=192.168.36.101
xdebug.remote_port=
xdebug.remote_handler = "dbgp"

安装xdebug前后运行截图:

安装前

xdebug影响php运行速度

安装后

xdebug影响php运行速度

可能原因:
速度慢并不是 xdebug 运行慢,而是配置了 xedebug ,它首先会去尝试连接调试服务器,连接不上才直接返回 php 结果。如果这时候打开 phpstorm 的调试监听,这时候 php 运行的速度就超快了。

参考:
http://www.oschina.net/question/656655_102191

http://www.111cn.net/sys/CentOS/74770.htm

http://www.cnblogs.com/dreamhome/p/3218744.html