繁体   English   中英

XDebug 未在 Windows 7 64 位 PHP 5.4 上加载

[英]XDebug not loading on Windows 7 64 bit PHP 5.4

我有 php 在 apache 上运行。我已经下载了我认为是正确的 xdebug 编译 dll php 版本 5.4 64 位 windows。我启用了线程安全并且它正在使用 VC9。 我已经下载了 dll 并将它放在这里:

C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll

这是我的 php.ini 中的内容:

[xdebug]
zend_extension = "C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll"

当我启动 Apache 时,出现以下错误:

[Wed Apr 04 17:01:56 2012] [notice] Parent: Received restart signal -- Restarting the server.
Failed loading C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll
hild process is ending.
[Wed Apr 04 17:01:56 2012] [notice] Apache/2.2.22 (Win32) PHP/5.4.0 configured -- resuming normal operations
[Wed Apr 04 17:01:56 2012] [notice] Server built: Jan 28 2012 11:16:39
[Wed Apr 04 17:01:56 2012] [notice] Parent: Created child process 2120
[Wed Apr 04 17:01:57 2012] [notice] Child 2120: Child process is running
[Wed Apr 04 17:01:57 2012] [notice] Child 2120: Acquired the start mutex.
[Wed Apr 04 17:01:57 2012] [notice] Child 2120: Starting 64 worker threads.
[Wed Apr 04 17:01:57 2012] [notice] Child 5624: Released the start mutex
[Wed Apr 04 17:01:58 2012] [notice] Child 5624: All worker threads have exited.
[Wed Apr 04 17:01:58 2012] [notice] Child 5624: Child process is exiting
Failed loading C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll

为了确保您下载了正确的二进制文件,您可以使用位于http://xdebug.org/wizard.php的向导,它会准确告诉您要下载哪个文件以及您应该将哪个 php.ini 文件放入其中zend_extension 行(当然,您现在使用的是正确的,因为您收到“加载失败”错误)。

好的,它现在正在工作,我想我知道出了什么问题。 我使用的是 PHP 的 64 位版本,但 Apache 的 32 位版本和 xdebug 的 64 位版本。 我重新开始并使用 Apache 2.4 32 位,因为 php5 模块似乎没有 64 位版本。 所以,我确保我拥有所有的 32 位版本。 我在 VC9 中使用 php5.4,线程安全。

这篇博文有助于设置它: http://lifeofageekadmin.com/how-install-apache-2-4-php-5-4-and-mysql-5-5-21-on-windows-7/

我终于让这个工作了。 按照 xdebug 网站上的说明,我使用向导将 dll 文件下载到“ext”目录。 然后向导告诉我将这一行添加到我的 php.ini 文件中: zend_extension=ext\php_xdebug-2.3.3-5.6-vc11.dll

这给了我上面看到的错误: Failed loading ext\php_xdebug-2.3.3-5.6-vc11.dll

我还尝试用正斜杠替换反斜杠,但这失败了,并显示消息: Failed loading ext\ext/php_xdebug-2.3.3-5.6-vc11.dll

查看最后一条消息,我想可能是扩展目录导致了问题,我在我的 php.ini 文件中看到这一行: extension_dir = "ext"

所以我改为使用: zend_extension=php_xdebug-2.3.3-5.6-vc11.dll并且有效!

在最新版本的xampp中你只需要在php.ini中添加zend_extension=xdebug即可,例如:

zend_extension=xdebug
[XDebug]
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "c:\xampp\php"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_connect_back=on
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="PHPSTORM"

好的,我知道这是一个非常古老的僵尸线程,但最近我自己遇到了这个问题,结果证明它有一个简单的解决方案。

PHP.INI 要求对目录使用正斜杠,而在 windows 下给出的安装 XDebug 的说明使用反斜杠。 所以对于上面的原始问题,解决方案是将 zend_extension 行更改为:

zend_extension = "C:/php5/extras/php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll"

希望这可以帮助。

查看C:\php5\ext ,看看php_xdebug.dll是否已经存在。 如果没有,请尝试将php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll重命名为php_xdebug.dll并将其放置在C:\php5\ext中,然后将您的php.ini更改为:

[xdebug]
zend_extension = "C:\php5\ext\php_xdebug.dll"

有同样的问题。 对我来说,我需要zend_extension的绝对路径,在引号中(但反斜杠没问题)。

我有 Windows 7 64 位和 php v5.4.4,但我需要下载的 x-debug 版本是:

PHP 5.4 VC9(32 位)(MD5:ffeb0215621d330fa53b249f0930ffae)

因为 IIS 无法使用 xdebug 64 位

还有我的 php.ini 说明:

[Xdebug]
zend_extension="C:\Program Files (x86)\iis express\PHP\v5.4\ext\php_xdebug-2.4.0rc4-5.4-vc9-nts.dll"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.profiler_enable=1
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "C:\temp\php"
xdebug.profiler_output_dir="C:\temp\php"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM