无法配置 Xdebug
我已经在本地主机上安装了 PHP 5.3.8,并尝试配置 Xdebug,但由于某种原因,Xdebug 似乎无法工作。我已将以下几行添加到我的 php.ini
文件中:
zend_extension = C:\Server\PHP\5.3.8\ext\php_xdebug-2.1.3-5.3-vc9.dll
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=”dbgp”
当然,zend_extension
路径中的文件是存在的。我也尝试过重新启动我的 Apache。
每个 PHP 版本都有特定类型的 Xdebug 还是这只是配置错误的问题?
编辑:
我已经尝试了 Xdebug 网站上提供的所有 2.1.3 和 2.1.2 dll,但它们似乎都不起作用...
编辑 2: 好吧,太好了,我刚刚得到了最新的 Xdebug 版本,但我的 var_dump
看起来仍然很糟糕......这是它们的样子:
array(3) { [0]=> string(4) "text" [1]=> string(4) "node" [2]=> string(6) "blabla" }
但它们过去看起来像这样:
array(3)
0 => 'text' string(4)
1 => 'node' string(4)
2 => 'blabla' string(6)
我如何获得他们看起来像这样吗?
I've installed PHP 5.3.8 on my localhost and I tried to configure Xdebug, but for some reason, Xdebug doesn't seem to work. I've added following lines to my php.ini
file:
zend_extension = C:\Server\PHP\5.3.8\ext\php_xdebug-2.1.3-5.3-vc9.dll
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=”dbgp”
And of course, the file in the zend_extension
path is exists. And I also have tried restarting my Apache.
Is there a specific type of Xdebug for every version of PHP or is this just a matter of a bad configuration?
EDIT:
I've tried every 2.1.3 and 2.1.2 dll available on the Xdebug site, but none of them seems to work...
EDIT 2:
Ok, great, I just got the latest Xdebug version working, but my var_dump
's still look awful... Here is what they look like:
array(3) { [0]=> string(4) "text" [1]=> string(4) "node" [2]=> string(6) "blabla" }
But they used to look like this:
array(3)
0 => 'text' string(4)
1 => 'node' string(4)
2 => 'blabla' string(6)
How do I get them to look like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Xdebug 有一个很棒的 phpinfo() 输出解析器,它可以准确确定您需要的 Xdebug 版本,甚至可以根据此为您提供个性化说明。只需访问:
http://xdebug.org/find-binary.php
,您就会立即启动并运行。
Xdebug has a fantastic phpinfo() output parser which determines exactly what version of Xdebug you need and even gives you personalised instructions based on this. Simply visit:
http://xdebug.org/find-binary.php
and you'll be up and running in no time.
如果你的 var_dump 看起来“糟糕”,那么你需要设置 html_errors=1。 Xdebug 尊重 PHP 的正常错误报告设置,并且(遗憾的是)在 PHP 5.3 中,默认值现在为 html_errors=0。只需在 php.ini 中将其设置回 1 即可。
If your var_dump looks "awful" then you need to set html_errors=1. Xdebug respects PHP's normal error reporting settings and (sadly) in PHP 5.3 that default now has html_errors=0. Simply set it back to 1 in php.ini.
当然xdebug版本必须与php版本兼容。您的看起来不错(您可以在下载页面中查看:在此处输入链接描述)。
接下来,检查 Zend 引擎是否正在使用 xdebug 运行。 phpinfo() 必须返回类似以下内容:
如果您没有看到“with Xdebug...”行,则问题出在 dll 上。如果您看到该行,则 xdebug 运行正常。那么问题就来自于客户端,可能是由于配置问题。
Of course the xdebug version must be compatible with the php version. Yours look well (you can check it in the download page: enter link description here).
Next, check the Zend Engine is running with xdebug. phpinfo() must return something like:
If you don't see the line "with Xdebug..." the problem is on the dll. If you see that line, xdebug is running ok. Then the problem comes from the client side, maybe due to a configuration problem.