为什么在我尝试过的每个 XAMPP 安装上 xdebug 都会使 apache 崩溃?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/206788/
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
Why does xdebug crash apache on every XAMPP install I've tried?
提问by
I've installed the Windows XAMPP package on three separate computers, 2 running Windows Vista 32 bit ( 1 Ultimate / 1 Home Premium ) and 1 running Windows Vista 64 Home Premium.
我已经在三台独立的计算机上安装了 Windows XAMPP 程序包,其中两台运行 Windows Vista 32 位(1 台 Ultimate / 1 家家庭高级版)和 1 台运行 Windows Vista 64 家庭高级版。
After enabling xdebug in php.ini and restarting apache, viewing the default XAMPP localhost index causes apache to crash in the same way every time, reporting 'php_xdebug.dll' as the Fault Module Name.
在 php.ini 中启用 xdebug 并重新启动 apache 后,查看默认的 XAMPP localhost 索引导致 apache 每次都以相同的方式崩溃,报告 'php_xdebug.dll' 作为 Fault Module Name。
Here's the full report from the Windows Crash Reporter thing:
这是来自 Windows Crash Reporter 的完整报告:
Problem signature:
Problem Event Name: APPCRASH
Application Name: apache.exe
Application Version: 2.2.9.0
Application Timestamp: 4853f994
Fault Module Name: php_xdebug.dll
Fault Module Version: 2.0.3.0
Fault Module Timestamp: 47fcd9b9
Exception Code: c0000005
Exception Offset: 00008493
OS Version: 6.0.6001.2.1.0.768.3
Locale ID: 1033
Additional Information 1: a34a
Additional Information 2: c9c5f4fd744690d388ab9d5b3eb051a7
Additional Information 3: cb2e
Additional Information 4: 650bb5690556a17e911375b94d3e16f0
I've tried Googling this issue but haven't found any resolution, only reports of similar errors.
我试过谷歌搜索这个问题,但没有找到任何解决方案,只有类似错误的报告。
EDIT: I enabled the extension line for php_xdebug.dll and that seems to have stopped the crashing so far.
编辑:我启用了 php_xdebug.dll 的扩展行,到目前为止似乎已经停止了崩溃。
回答by
I'm running XAMPP for Windows Version 1.7.1 on my Win7 machine with xDebug and it works perfect.
我正在使用 xDebug 在我的 Win7 机器上运行适用于 Windows 版本 1.7.1 的 XAMPP,它运行完美。
Check if you have SP1 installed, and then follow these notes:
检查您是否安装了 SP1,然后按照以下说明操作:
Find the line containing
implicit_flushand set it as follows:implicit_flush = OnFind the section called
[Zend]and comment out all of the lines by putting a semi-colon (";") at the start of each line.Find the line:
zend_extension = "c:\xampp\php\ext\php_xdebug.dll"and uncomment it.Find the
[XDebug]section and uncomment all of the lines (except for the first line which is an actual comment). For Windows, it should look like the example below:[XDebug] ;; Only Zend OR (!) XDebug zend_extension_ts="C:\xampp\php\ext\php_xdebug.dll" xdebug.remote_enable=true xdebug.remote_host=localhost xdebug.remote_port=10000 xdebug.remote_handler=dbgp xdebug.profiler_enable=1 xdebug.profiler_output_dir="C:\xampp\tmp"
找到包含的行
implicit_flush并将其设置如下:implicit_flush = On[Zend]通过在每行的开头放置一个分号 (";"),找到被调用的部分并注释掉所有行。找到该行:
zend_extension = "c:\xampp\php\ext\php_xdebug.dll"并取消注释。找到该
[XDebug]部分并取消所有行的注释(除了第一行是实际注释)。对于 Windows,它应该类似于下面的示例:[XDebug] ;; Only Zend OR (!) XDebug zend_extension_ts="C:\xampp\php\ext\php_xdebug.dll" xdebug.remote_enable=true xdebug.remote_host=localhost xdebug.remote_port=10000 xdebug.remote_handler=dbgp xdebug.profiler_enable=1 xdebug.profiler_output_dir="C:\xampp\tmp"
回答by ferweb
I was looking in internet for this issue and tried many solutions and none of them worked. I tried this configuration, just a last test and worked for me, in Eclipse change under Windows/Preferences/PHP/Debug and select Xdebug as PHP debugger.
我在互联网上寻找这个问题并尝试了很多解决方案,但没有一个奏效。我尝试了这个配置,只是最后一次测试并且对我有用,在 Windows/Preferences/PHP/Debug 下的 Eclipse 更改中并选择 Xdebug 作为 PHP 调试器。
回答by ferweb
Ran across this doing a Google search for why XDebug was crashing my WAMP Apache. I just upgraded to a Vista 64 laptop with the current version of WAMP(2.0), and here is what I put in my php.ini to make the crashing stop.
在谷歌搜索时遇到了这个问题,为什么 XDebug 会导致我的 WAMP Apache 崩溃。我刚刚升级到带有当前版本的 WAMP(2.0) 的 Vista 64 笔记本电脑,这是我在 php.ini 中放入的内容以防止崩溃。
I am using NetBeans as my IDE, and debugging works just fine.
我使用 NetBeans 作为我的 IDE,并且调试工作正常。
First off, comment out in your active php.ini.
首先,在您的活动 php.ini 中注释掉。
;extension=php_xdebug-2.0.4-5.2.8.dll
Then add this to the bottom of your active php.ini (Adjust your directories and xdebug filename accordingly.)
然后将其添加到活动 php.ini 的底部(相应地调整您的目录和 xdebug 文件名。)
[XDebug]
; Only Zend OR (!) XDebug
zend_extension_ts="C:/Program Files (x86)/wamp/bin/php/php5.2.9-2/ext/php_xdebug-2.0.4-5.2.8.dll"
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir="C:/Program Files (x86)/wamp/tmp"
回答by ferweb
there is a thread safety problem with XDebug on Vista, I had the same problem using IIS7 with PHP as an ISAPI module, the server crashed randomly if the xdebug.dll was loaded, then I found an article that described that PHP+XDebug (on Vista) should be run in a single-thread-mode.
Vista 上的 XDebug 存在线程安全问题,我在使用 IIS7 和 PHP 作为 ISAPI 模块时遇到了同样的问题,如果加载了 xdebug.dll,服务器会随机崩溃,然后我找到了一篇文章,描述了 PHP+XDebug(在Vista) 应该在单线程模式下运行。
I got it to work following way:
我让它按照以下方式工作:
A non-thread-safe PHP version, a non-thread-safe xdebug.dll for your PHP version, in php.ini it shuold be loaded as zend_extension="C:/FullPathToXdebugDll" (without "_ts"!), running php in CGI (or better FastCGI) mode. (CGI/FastCGI forces it to be single-threaded).
一个非线程安全的 PHP 版本,一个非线程安全的 xdebug.dll 用于你的 PHP 版本,在 php.ini 中它应该被加载为 zend_extension="C:/FullPathToXdebugDll"(没有“_ts”!),运行 php在 CGI(或更好的 FastCGI)模式下。(CGI/FastCGI 强制它是单线程的)。
here the link to the article: http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/
这里是文章的链接:http: //learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/
Now I'm looking for a possibility to do the same thing with Xampp or InstantRails (or something like that) to run it on my notebook (Vista Home Premium has no IIS), but i dont know how to force apache to run in a single-thread-mode, does someone know how to do that?
现在我正在寻找一种可能性,用 Xampp 或 InstantRails(或类似的东西)在我的笔记本上运行它(Vista Home Premium 没有 IIS),但我不知道如何强制 apache 在一个单线程模式,有人知道怎么做吗?
回答by ferweb
Eugen has it right for me.
尤金适合我。
Go download the non thread safe dll at http://xdebug.org/download.php
i.e. 5.2 VC6 Non-thread-safe (32 bit)save it into your
\xampp\php\extdirectoryopen your php.ini
C:\xampp\php\php.ini
去http://xdebug.org/download.php下载非线程安全的 dll
ie 5.2 VC6 Non-thread-safe (32 bit)将其保存到您的
\xampp\php\ext目录中打开你的 php.ini
C:\xampp\php\php.ini
Scroll to the bottom and find [XDebug]and replace
滚动到底部并找到[XDebug]并替换
zend_extension_ts="C:\xampp\php\ext\php_xdebug.dll"
with this
有了这个
zend_extension="C:\xampp\php\ext\php_xdebug-2.0.5-5.2-nts.dll"
so it looks like this:
所以它看起来像这样:
[XDebug]
;; Only Zend OR (!) XDebug
zend_extension="C:\xampp\php\ext\php_xdebug-2.0.5-5.2-nts.dll"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="C:\xampp\tmp"
回答by user106011
This might be helpful to someone. I had a repeatable Apache crash when debugging PHP web pages with Eclipse and XDebug and tried all kinds of reinstalls and PHP.INI changes and eventually figured out that my problem related to the use of a duplicate variable name in seperate files. One file included the other and both had (let's say) $foo. Once I renamed $foo to $newfoo in the second file, and restarted Apache, I got rid of my crashes.
这可能对某人有帮助。在使用 Eclipse 和 XDebug 调试 PHP 网页时,我遇到了可重复的 Apache 崩溃,并尝试了各种重新安装和 PHP.INI 更改,最终发现我的问题与在单独的文件中使用重复的变量名有关。一个文件包含另一个文件,并且都有(假设)$foo。一旦我在第二个文件中将 $foo 重命名为 $newfoo 并重新启动 Apache,我就摆脱了崩溃。
Also, kind of related, I was never able to get the PHP.INI file to work as is widely documented here and elsewhere. I had to remove the _ts from zend-extension, see below, to get the phpinfo() text: with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans.
此外,有点相关,我从来没有能够让 PHP.INI 文件像这里和其他地方广泛记录的那样工作。我不得不从 zend-extension 中删除 _ts,见下文,以获取 phpinfo() 文本:使用 Xdebug v2.0.5,版权所有 (c) 2002-2008,由 Derick Rethans。
XAMPP 1.7.2 (using php_xdebug.dll that came with) PHP 5.3.0
XAMPP 1.7.2(使用附带的 php_xdebug.dll) PHP 5.3.0
Here is my PHP.INI file snippet:
这是我的 PHP.INI 文件片段:
xdebug.remote_enable=1 xdebug.remote_host="127.0.0.1" xdebug.remote_port=9000 xdebug.remote_handler="dbgp" zend_extension="C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=1 xdebug.remote_host="127.0.0.1" xdebug.remote_port=9000 xdebug.remote_handler="dbgp" zend_extension="C:\xampp\php\ext\php_xdebug.dll"
回答by Vafliik
I had the same problem. It was resolved by latest version of xdebug (2.0.6). It is stil in dev mode, but for me it is more stable than previous releases :)
我有同样的问题。它已由最新版本的 xdebug (2.0.6) 解决。它仍然处于开发模式,但对我来说它比以前的版本更稳定:)
It is a part of XAMPP 1.7.3beta http://www.apachefriends.org/en/xampp-beta.html
它是 XAMPP 1.7.3beta http://www.apachefriends.org/en/xampp-beta.html的一部分
Enabling xdebug was only matter of uncommenting one line in xampp/php/php.ini
启用 xdebug 只是在 xampp/php/php.ini 中取消注释一行
HTH
HTH
回答by Vikram Phaneendra
install new version of XAMPP
安装新版本的 XAMPP
回答by Dane
I got it working using Xampp 1.7.3 (php 5.3.1) on Windows 7 Ultimate 6.1.7600. Following the author's post edit of un-commenting the line: zend_extension = C:\xampp\php\ext\php_xdebug.dllin xampp\php\php.ini, i managed to get the apache http server to stop crashing!
我在 Windows 7 Ultimate 6.1.7600 上使用 Xampp 1.7.3 (php 5.3.1) 让它工作。按照作者对取消注释行的帖子编辑:zend_extension = C:\xampp\php\ext\php_xdebug.dll在 xampp\php\php.ini 中,我设法让 apache http 服务器停止崩溃!
Turns out Xampp comes with its own version of xdebug and I never even needed to download anything in the first place. You just need to un-comment the aforementioned line and enable the other features of xdebug you want in the [xdebug] section of php.ini.
结果证明 Xampp 带有自己的 xdebug 版本,我什至不需要从一开始就下载任何东西。您只需要取消对上述行的注释并在 php.ini 的 [xdebug] 部分启用您想要的 xdebug 的其他功能。
The version of xdebug that came with my install of Xampp is 2.0.6-dev. Hope this helps!
我安装 Xampp 时附带的 xdebug 版本是 2.0.6-dev。希望这可以帮助!
EDIT: forgot to mention that I am running the x64 flavor of windows 7 :P
编辑:忘了提到我正在运行 Windows 7 的 x64 风格:P
回答by Thomas Hucke
Solution at http://community.activestate.com/forum-topic/apache-crashes#comment-9812Obviousliy buggy apache module - runs php as CGI.
http://community.activestate.com/forum-topic/apache-crashes#comment-9812 上的解决方案 Obviousliy 有问题的 apache 模块 - 将 php 作为 CGI 运行。

