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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10019966/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 21:08:36  来源:igfitidea点击:

XDebug not loading on Windows 7 64 bit PHP 5.4

phpxdebug

提问by Jon Hargett

I have php running on apache. I have downloaded what I think to be the correct xdebug compiled dll for php version 5.4 64 bit windows. I have thread saftey enabled and it is using VC9. I have downloaded the dll and placed it here:

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

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

Here is what I have in my php.ini:

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

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

When I start Apache, I get this error:

当我启动 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

采纳答案by Jon Hargett

OK, it is working now and I think I know what was wrong. I was using the 64 bit version of PHP but the 32 bit version of Apache and the 64 bit version of xdebug. I started over and used Apache 2.4 32 bit, since there doesn't seem to be a 64 bit version with the php5 module. So, I made sure I have the 32 bit version of everything. I am using php5.4 with VC9, Thread Safe.

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

This blog post helped in setting it up: http://lifeofageekadmin.com/how-install-apache-2-4-php-5-4-and-mysql-5-5-21-on-windows-7/

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

回答by Derick

In order to make sure that you've downloaded the correct binary, you can use the wizard at http://xdebug.org/wizard.phpIt will tell you exactly which file to download and in which php.ini file you should put the zend_extension line (you're using the correct one now of course, as you get the "Failed to load" error).

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

回答by Chris

I finally got this to work. Following the directions on the xdebug website, I used the wizard and downloaded the dll file to the 'ext' directory. The wizard then told me to add this line to my php.ini file: zend_extension=ext\php_xdebug-2.3.3-5.6-vc11.dll

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

This gave me the error seen above: Failed loading ext\php_xdebug-2.3.3-5.6-vc11.dll

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

I also tried replacing the backwards slash with a forward slash, but this failed with the message: Failed loading ext\ext/php_xdebug-2.3.3-5.6-vc11.dll

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

Looking at that last message, I thought maybe the extension directory was causing issues, and I saw that in my php.ini file was this line: extension_dir = "ext"

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

So I changed to using: zend_extension=php_xdebug-2.3.3-5.6-vc11.dllAnd it worked!!

所以我改为使用:zend_extension=php_xdebug-2.3.3-5.6-vc11.dll它奏效了!!

回答by DolDurma

in latest version of xamppyou only need to add zend_extension=xdebugto php.ini, for example:

在最新版本中,xampp您只需要添加zend_extension=xdebugphp.ini,例如:

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"

回答by Dave S.

OK, I know that this is a really old zombie thread, but having run through this problem myself recently, it turns out to have a trivial solution.

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

PHP.INI requires the use of forwards slashes for directories, whereas the instructions given for installing XDebug under windows uses backslashes. SO for the above original problem, the solution is to change the zend_extension line to read:

PHP.INI 要求对目录使用正斜杠,而在 windows 下安装 XDebug 给出的说明使用反斜杠。SO对于上述原问题,解决办法是将zend_extension行改为:

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

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

Hope this helps.

希望这可以帮助。

回答by Xenon

Take a look in C:\php5\extand see if php_xdebug.dllis in there already. If not, try renaming php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dllto php_xdebug.dlland placing it in C:\php5\ext, then change your php.iniaddition to:

进去C:\php5\ext看看php_xdebug.dll是不是已经在里面了。如果没有,请尝试将其重命名php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dllphp_xdebug.dll并将其放置在 中C:\php5\ext,然后将您的php.ini添加更改为:

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

回答by felixfbecker

Had the same issue. For me, I needed the absolute path for zend_extension, in quotes (but backslashes are fine).

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

回答by Lev K.

I have Windows 7 64bit and php v5.4.4, but version of x-debug that i need to download is :

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

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

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

because IIS can't work with xdebug 64bit

因为 IIS 不能使用 xdebug 64bit

also my php.ini instructions :

还有我的 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"