XDebug 真的很慢
我正在尝试让 XDebug 在我的本地 wamp 安装(Uniform Server 8)上运行。
但是当我把
我的 php.ini 中的xdebug.remote_enable=1
(这是我的 IDE 使用 xdebug 所必需的),加载页面变得非常慢,每页慢 5 秒。但调试器可以工作。
我以前没有使用过 xdebug,但我可以想象它通常不应该花这么长时间。我很确定这可能与使用 symfony2 框架有关。
有谁知道是什么原因造成的?
I am trying to get XDebug working on my local wamp installation (Uniform Server 8).
However when I put
xdebug.remote_enable=1
in my php.ini, which is required for my IDE to use xdebug, loading the pages gets really slow as in 5 seconds per page slow. The debugger works though.
I haven't used xdebug before but I can imagine that it normally shouldn't take this long. I'm pretty sure it might have something to do with using the symfony2 framework.
Does anyone have an idea what's causing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许是因为这就是它的作用!
检查 xdebug 日志的默认存储位置(大多数时候 /tmp/xdebug/something)
这在 Windows 上与在 UNIX/Linux 系统上有所不同。
如果您希望将它们放置/命名在其他地方,请在 php.ini 中设置它们:
xdebug.profiler_output_dir
类型:字符串,默认值:/tmp
探查器输出将写入的目录,请确保运行 PHP 的用户对该目录具有写入权限。无法使用 ini_set() 在脚本中设置此设置。
xdebug.profiler_output_name
类型:字符串,默认值:cachegrind.out.%p
此设置确定用于转储跟踪的文件的名称。该设置使用格式说明符指定格式,与 sprintf() 和 strftime() 非常相似。有多种格式说明符可用于格式化文件名。
生成这些文件会给您的系统带来负担。但这些是您分析代码所需的。
在再次实际使用它之前,请先阅读 http://xdebug.org/docs ,以便您知道到底是什么正在努力做。
It's maybe because this is what it does!
Check the default storage place for xdebug logs (most of the times /tmp/xdebug/something)
which on Windows would be something different than on unix/linux systems.
set these in your php.ini if you want them placed/named somewhere else:
xdebug.profiler_output_dir
Type: string, Default value: /tmp
The directory where the profiler output will be written to, make sure that the user who the PHP will be running as has write permissions to that directory. This setting can not be set in your script with ini_set().
xdebug.profiler_output_name
Type: string, Default value: cachegrind.out.%p
This setting determines the name of the file that is used to dump traces into. The setting specifies the format with format specifiers, very similar to sprintf() and strftime(). There are several format specifiers that can be used to format the file name.
Generating these files is taxing to your system. But these are what you need to profile your code.
Also go read http://xdebug.org/docs before you actually use it again so that you know what exactly you are trying to do.
根据 SO 的另一个答案,您需要在 php.ini 中设置 xdebug.remote_autostart = 0
As per another answer on SO, you need to set xdebug.remote_autostart = 0 in your php.ini