【发布时间】:2015-10-31 04:23:53
【问题描述】:
我已在我的 PC(使用 Windows 10)上安装了 Apache 2.4 和 PHP 5.6。
启用 Xdebug 后,PHP 的运行速度比没有 Xdebug 时慢 10 倍(!)。
这是php.ini 配置:
zend_extension = "php_xdebug-2.3.3-5.6-vc11-x86_64.dll"
xdebug.remote_autostart = 0
xdebug.profiler_enable = 0
xdebug.profiler_output_dir = "C:\PHP\tmp"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_mode=req
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
xdebug.trace_output_dir = "C:\PHP\tmp"
xdebug.auto_trace = 0
xdebug.var_display_max_depth = 3
xdebug.remote_connect_back = 0
我已确保禁用分析器和自动启动。 有谁知道这种行为的原因是什么?
【问题讨论】:
-
这很正常。我认为
-
只有在您的代码中有大量错误时这才是正常的。因此,请检查 php 错误日志,尤其是当您停止 PHP 向屏幕显示错误时。我打赌你会发现一大堆错误
-
奇怪的是,当 xdebug 被禁用时它会减慢它的速度。我肯定已经看到在函数或对象繁重的代码中启用 xdebug 会大大降低速度,但我不希望禁用它时会出现这种减速。
-
这不正常,因为我在 Linux 和 Windows 7 上没有看到这样的问题。在这些系统上,xdebug 使 php 的速度减慢不超过 2 倍。
-
更新到 PHP 5.6 (Win 8.1) 后我遇到了同样的问题