无法让 Xdebug 在 Windows 7 上运行

发布于 2024-08-14 11:58:54 字数 810 浏览 5 评论 0原文

我安装了最新的 XAMPP 包,其中包括 PHP 5.3.0。我正在尝试启用 Xdebug,但它不起作用。

以下是我在 XAMPP 附带的 php.ini 中所做的更改:

; uncommented
zend_extension = "X:\xampp\php\ext\php_xdebug.dll"

; added the following lines:
xdebug.remote_enable=true
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp

Apache 启动正常,但是当我在浏览器中打开 http://localhost/ 时,出现以下错误:

alt text

如果我单击关闭程序按钮,错误消息将在一秒钟内重新出现,就像在无限循环。我非常感谢任何帮助使其发挥作用。

我正在运行全新安装的 Windows 7 Ultimate 64 位。

编辑: 从 phpinfo() 的结果来看:

Zend Extension Build    API220090626,TS,VC6 
PHP Extension Build     API20090626,TS,VC6 
Debug Build             no 
Thread Safety           enabled

I installed the latest XAMPP package which includes PHP 5.3.0. I am trying to enable Xdebug, but it just won't work.

Here's what I changed in the php.ini shipped with XAMPP:

; uncommented
zend_extension = "X:\xampp\php\ext\php_xdebug.dll"

; added the following lines:
xdebug.remote_enable=true
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp

Apache starts fine, but when I open http://localhost/ in my browser, I get the following error:

alt text

If I click the Close the program button, the error message will reappear in a second as if it was in an infinite loop. I'd greatly appreciate any help in getting this to work.

I am running a fresh install of Windows 7 Ultimate 64-bit.

EDIT:
From the result of phpinfo():

Zend Extension Build    API220090626,TS,VC6 
PHP Extension Build     API20090626,TS,VC6 
Debug Build             no 
Thread Safety           enabled

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

一萌ing 2024-08-21 11:58:54

您可能使用了错误的 Xdebug 版本。我会看一下 phpinfo() 并将其中的信息与 不同版本的 Xdebug dll

具体来说,您想查看是否启用了“线程安全”,并且需要知道您运行的是 VC6 编译的 PHP 还是 VC9(如果您使用 Apache,几乎可以保证您需要 VC6)。

It's possible you have the wrong version of Xdebug. I would take a look at phpinfo() and compare the information there to the different versions of the Xdebug dll.

Specifically, you want to see if "Thread Safety" is enabled, and you need to know whether you're running a VC6-compiled PHP or a VC9 (if you're using Apache, it's almost guaranteed that you want the VC6).

尸血腥色 2024-08-21 11:58:54

您是否尝试过 XDEBUG 的自定义安装向导,它会分析您的 php 安装并提供您需要遵循的确切步骤

Windows 二进制文件通常适用于上述 PHP 版本的每个迷你版本,尽管该扩展是针对当时最新的 PHP 版本构建的时间。 VCx 标记告诉您扩展是使用哪个编译器构建的,以及非线程安全的 ZTS 是否已禁用。这些限定符需要与您正在使用的 PHP 版本相匹配。如果您不知道需要哪一个,请参阅自定义安装说明。

http://xdebug.org/wizard.php

只需将您的 phpinfo 粘贴到文本框中即可将获得您的 php 所需的确切 xdebug dll

Have you tried custom installation wizard of XDEBUG, it analyses your php installation and provides exact steps you need to follow

The Windows binaries generally work for every mini release for the mentioned PHP version, although the extension is built against the most current PHP version at that time. The VCx marker tells with which compiler the extension was built, and Non-thread-safe whether ZTS was disabled. Those qualifiers need to match the PHP version you're using. If you don't know which one you need, please refer to the custom installation instructions.

http://xdebug.org/wizard.php

Just paste your phpinfo out put in the text box and you will get exact xdebug dll you would need for your php

狼亦尘 2024-08-21 11:58:54

坦白说,我也经历了两天非常糟糕的日子,我现在不知道最后是什么解决了这个问题,
所以这里是我的做法和陷阱的集合:

; this is the thread safe version,
; the absence of _nts_ in the dll name 'shows' this
; do not use _ts, your library won't get registered and won't show in phpInfo()
zend_extension = "D:/wamp/bin/php/php5.3.8/zend_ext/php_xdebug-2.1.2-5.3-vc9-x86_64.dll"

检查你的 php.ini,检查 phpinfo() 是否所有值(到达)

xdebug.remote_enable = on
xdebug.remote_handler=dbgp
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
; if you have multiple virtual hosts ( like 'local.fooclient' )
; maybe using the IP is safer (for any same-machine-debugging)
xdebug.remote_host=127.0.0.1
; maybe a -much- lower port helped, 84 was free. use netstat to figure out.
xdebug.remote_port=84
; idekey! also see note below
xdebug.idekey=netbeans-xdebug

更多陷阱:

我多次看到 xdebug.remote_handle(没有 r)的拼写错误在网络上。提防。

关于 idekey 的注释:上面的 idekey 确实在 phpinfo() 中显示为主值,但是
被“本地值”(如 MYMACHINENAME$)覆盖。 ==>设置一个名为 DBGP_IDEKEY 的全局环境变量(在计算机属性中)并重新启动(或者可能只是注销)到(也)netbeans-xdebug 会有所帮助!再次:重新检查 phpInfo() 是否生效。

当然,将 netbeans-menu:options->php tab->debugging 部分调整为该端口和会话 ID。

这里是一个脚本,用于检查(通过 php 方式)您是否打算谈论该端口至已开放。 (在下面的评论中,对于那些懒惰的人也从图像中输入)

为了您的浏览器连接,不要开始忘记(在沮丧中)始终附加调试启动获取参数:

  http://localhost/myTest.php?XDEBUG_SESSION_START=netbeans-xdebug

端口边界此工具也可能有所帮助。

四重检查您是否将所有内容的 VC6 和 VC9 编译版本分开。

从命令行运行 whatever/path/php.exe myTest.php (完成上述设置后)也可能会显示其他错误(确实如此,当我修补不正确的 dll 时)。

我可以推荐 http://www.wampserver.com
(出于个人原因,它比流行的 xampp 包更适合我......)

frank-ly, I also had 2 REALLY bad days, and I don't now what finally fixed it,
so here's my collection of Do's and pitfalls:

; this is the thread safe version,
; the absence of _nts_ in the dll name 'shows' this
; do not use _ts, your library won't get registered and won't show in phpInfo()
zend_extension = "D:/wamp/bin/php/php5.3.8/zend_ext/php_xdebug-2.1.2-5.3-vc9-x86_64.dll"

check your php.ini, check phpinfo() if all values (arrive)

xdebug.remote_enable = on
xdebug.remote_handler=dbgp
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
; if you have multiple virtual hosts ( like 'local.fooclient' )
; maybe using the IP is safer (for any same-machine-debugging)
xdebug.remote_host=127.0.0.1
; maybe a -much- lower port helped, 84 was free. use netstat to figure out.
xdebug.remote_port=84
; idekey! also see note below
xdebug.idekey=netbeans-xdebug

More Pitfalls:

I have seen a typo of xdebug.remote_handle (without r) several times on the web. beware.

A note on the idekey: The above idekey did show in phpinfo() as master value, BUT
was overridden with a 'local value' like MYMACHINENAME$. ==> Setting a global env var (in computer properties) named DBGP_IDEKEY and rebooting (or maybe just logging out) to (also) netbeans-xdebug helps! Again: re-check in phpInfo() it took effect.

Of course adjust netbeans-menu:options->php tab->debugging section to this port and session id.

Here is a script, to check (by php means) if that port you intend to talk to is open. (further below also in the comments, for those to lazy too type from the image)

For your browser to connect, don't start to forget (amidst frustration) to always attach the debug-starting get-argument:

  http://localhost/myTest.php?XDEBUG_SESSION_START=netbeans-xdebug

On the port frontier, also this tool might help.

Quadruplecheck you are keeping VC6 and VC9 compiled versions of everything apart.

Running your whatever/path/php.exe myTest.php from the command line (once the above settings are done) might also reveal additional errors (it did, while I was tinkering with an incorrect dll).

I can recommend http://www.wampserver.com
(for personal reasons it fits me better than the popular xampp package...)

善良天后 2024-08-21 11:58:54

是的,有一个已知问题 - 几乎不可能让 Xdebug 与最新的 Xampp 和 64 位 Vista/Win 7 一起工作。

有一个 bug 报告,许多用户对此抱怨。

解决方案似乎是Xampp 上的最新测试版。它包含 xdebug 版本 2.0.6 (dev),并且运行良好。

我在 64 位 Vista 上测试了大约 10 天,还没有遇到任何问题。

Yes, there is a known problem - is almost impossible to get Xdebug working with latest Xampp and 64-bit Vista/Win 7.

There is a bug reported with many users complaining about it.

The solution seems to be latest beta version on Xampp. It includes version 2.0.6 (dev) of xdebug and it is working just fine.

I tested it on 64-bit Vista for approx 10 days and not encountered any problem yet.

葬シ愛 2024-08-21 11:58:54

当 xdebug 不与 XAMPP 一起安装时,仅使用 PHP(32 位、TS、VC6,在 C:\Program Files (x86)\PHP 中)和 Windows 7(64 位)上的 Apache(32 位)在 php.ini 中安装时/em> 您需要指定 Program Files 的 x86 文件夹的完整路径。

zend_extension="C:\Program Files (x86)\PHP\ext\php_xdebug-2.1.1-5.3-vc6.dll"

并且不是

zend_extension="C:\Program Files\PHP\ext\php_xdebug-2.1.1-5.3-vc6.dll"

这是我的错误,当更改为x86文件夹时,xdebug开始完美工作。希望这对您也有帮助。

When xdebug is installed not with XAMPP, just with PHP (32bit, TS, VC6, in C:\Program Files (x86)\PHP) and Apache (32bit) on Windows 7 (64bit), in php.ini you need to specify the full path to x86 folder of Program Files like.

zend_extension="C:\Program Files (x86)\PHP\ext\php_xdebug-2.1.1-5.3-vc6.dll"

and NOT

zend_extension="C:\Program Files\PHP\ext\php_xdebug-2.1.1-5.3-vc6.dll"

This was my mistake, when changed to x86 folder, xdebug started to work perfectly. Hope this help you, too.

装纯掩盖桑 2024-08-21 11:58:54

就像其他人所说,你需要将你的 xdebug 版本与你的 php 版本相匹配。

您已经匹配了 PHP 版本号、线程安全性和编译器。

如果您还没有弄清楚(这是一个旧线程),您缺少的是 INI 配置。如果您正在加载线程安全的模块,则需要使用以下内容line:

zend_extension="C:\Path\To\The\Extension.dll"

如果模块不是线程安全,那么您将使用您一直在尝试使用的INI指令。

这仅适用于 zend_extension's 而不是常规扩展。

Like others have said, you need to match your xdebug version with your php version.

You've already matched up PHP version number, thread safety, and compiler.

If you haven't already figured it out (this is an old thread), what you're missing is the INI configuration. If you are loading a module that's thread safe, you need to use the following line:

zend_extension="C:\Path\To\The\Extension.dll"

If the module is not thread safe, then you use the INI directive you've been trying to use.

This only applies to zend_extension's and not regular extensions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文