xdebug 未加载。 apache重启后在phpinfo()中找不到
我一直在搜寻我能找到的所有资源,但一无所获。当我启动调试会话时,我在 NetBeans 6.9 中收到可怕的“等待连接”消息。经过大量阅读后,大多数人都能够让 phpinfo() 显示它加载了 xdebug 模块。我的情况并非如此。
我使用这个调用通过 SVN 下载了源代码,
svn co svn://svn.xdebug.org/svn/xdebug/xdebug/trunk xdebug
我切换到 xdebug 目录,然后在源代码上运行 phpize
sudo /Applications/MAMP/bin/php5/bin/phpize
Password:
grep: /Applications/MAMP/bin/php5/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php5/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php5/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
一个大胖子什么也没有!引用的目录甚至不存在。因此,我假设我在这一点之外所做的任何 .ini 调整都是无用的。如果我执行 whereis php,我会在 /usr/bin 中找到它。这是操作系统预加载的默认 php。我不想要那个。我需要使用随 MAMP 安装的 php。我简直不敢相信让这东西发挥作用是多么令人沮丧!
根据记录,我的 php.ini 中的 xdebug 部分如下所示:
[xdebug]
; xdebug config for Linux and Mac OS X
zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"
xdebug.profiler_enable=1
xdebug.profiler_output_name=xdebug.cachegrind-out.%s.%p
xdebug.remote_log="/Applications/MAMP/logs/xdebug_log.log"
这是使 xdebug 工作的许多不同尝试的大杂烩。所以,我不知道哪些部分是有效的,哪些部分是无效的。
我把自己置于专家的怜悯之下,因为我显然不是他们中的一员。我现在完全不知道如何进行。
提前致谢。
I've been scouring every resource I could find, but came up empty. I get the dreaded "Waiting for Connection" message in NetBeans 6.9 when I start a debug session. After much reading, most folks are able to get phpinfo() to display that it loaded the xdebug module. Not so with me.
I downloaded the source through SVN using this call
svn co svn://svn.xdebug.org/svn/xdebug/xdebug/trunk xdebug
I switched to the xdebug directory and then ran phpize on the source
sudo /Applications/MAMP/bin/php5/bin/phpize
Password:
grep: /Applications/MAMP/bin/php5/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php5/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php5/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
A big fat nothing! The referenced directories don't even exist. So, I make the assumption that any .ini tweaking I do beyond this point is useless. If I do a whereis php, I find it in /usr/bin. That's the default php pre-loaded with the OS. I don't want that one. I need to use the php installed with MAMP. I cannot believe how insanely frustrating it is to get this thing working!
For the record, my xdebug section in my php.ini looks like this:
[xdebug]
; xdebug config for Linux and Mac OS X
zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"
xdebug.profiler_enable=1
xdebug.profiler_output_name=xdebug.cachegrind-out.%s.%p
xdebug.remote_log="/Applications/MAMP/logs/xdebug_log.log"
It's a mish-mash of many different attempts to get xdebug to work. So, I don't know which pieces are valid or not.
I throw myself on the mercy of the experts because I obviously am not one of them. I have absolutely no idea how to proceed at this point.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要在 MAMP 目录而不是系统路径中使用 phpize,您应该将 PHP 二进制文件的 MAMP 目录添加到 $PATH。下面我使用的是 MAMP 1.9.1,它提供 PHP 5.2 和 PHP 5.3。我们假设您正在针对 PHP 5.3 进行编译。
打开或创建
~/.bash_profile
并输入以下内容:您可能还需要 chmod
/Applications/MAMP/bin/php5.3/bin
中的二进制文件可执行文件:重新启动终端会话以加载新的 $PATH。运行命令
which phpize
,它应该显示/Applications/MAMP/bin/php5.3/bin/phpize
。如果没有,则 MAMP 目录中phpize
的路径不会加载到 $PATH 中。在终端中使用echo $PATH
确保/Applications/MAMP/bin/php5.3/bin
位于 $PATH 中。要编译 xDebug,您需要编译 PHP 时的头文件。这些可以在 MAMP 网站上的 DMG 中找到,称为“MAMP 组件”:http:// /www.mamp.info/en/downloads/index.html
解压 MAMP 组件并将
MAMP_src
复制到您的桌面。解压MAMP_src/php-5.3.2.tar.gz
并将其移至php-config --includes
中的包含路径,其中应包含/Applications/ MAMP/bin/php5.3/include/php
。您现在可以在 xDebug 源目录中运行 phpize。
To use phpize in the MAMP directory instead of your system path, you should add MAMP's directory for PHP binaries to your $PATH. Below I'm using MAMP 1.9.1, which offers PHP 5.2 and PHP 5.3. We'll assume you're compiling for PHP 5.3.
Open or create
~/.bash_profile
and put the following contents:You may also need to chmod the binaries inside
/Applications/MAMP/bin/php5.3/bin
to be executable:Restart your Terminal session for the new $PATH to be loaded. Run the command
which phpize
and it should display/Applications/MAMP/bin/php5.3/bin/phpize
. If not, the path tophpize
in your MAMP directory is not being loaded in your $PATH. Useecho $PATH
in Terminal to make sure/Applications/MAMP/bin/php5.3/bin
is in the $PATH.To get xDebug to compile, you need the header files from when PHP was compiled. These are available on the MAMP website in a DMG, and called "MAMP Components": http://www.mamp.info/en/downloads/index.html
Unpack MAMP Components and copy
MAMP_src
to your Desktop. UnpackMAMP_src/php-5.3.2.tar.gz
and move it into the include path present inphp-config --includes
which should include/Applications/MAMP/bin/php5.3/include/php
.You can now run
phpize
in the xDebug source dir.我在 Mac OSX 10.6 上使用 XAMPP 时遇到了类似的问题。
在 xdebug 下载目录中运行 phpize 时,我没有得到版本号。
我必须安装“开发包”,它将 /Applications/XAMPP/xamppfiles/include 和其他文件添加到您的 XAMPP 安装中。安装开发包也修复了pecl,所以我尝试使用pecl来安装xdebug。
但 apache 无法启动并出现错误
我尝试从源代码编译并得到相同的 '错误的架构'错误
最后我只使用了 KomodoIDE 二进制文件从活动状态有效。
I had a similar problem with XAMPP on Mac OSX 10.6.
I got no version Numbers when running phpize in the xdebug download directory.
I had to install the 'Development Package' which adds /Applications/XAMPP/xamppfiles/include and other files to your XAMPP install. Installing the Development Package also fixed pecl so I tried using pecl to install xdebug.
but apache failed to start with error
I tried compiling from source and got the same 'wrong architecture' errors
Finally I just used the KomodoIDE binary from active state which worked.
由于 PHP 5.3.1 的问题,我自己刚刚开始使用 xdebug。几周前我已经按照说明使用了 PECL,但看起来 phpize 是新的黑色。我查看了新指令(从我的 phpinfo() 生成)@ http://xdebug.org/find -binary.php
值得注意的是:有
两件事:
您检查过 phpize 是否是最新的吗?
如果这不起作用,请尝试以下说明:http://xdebug.org/docs/install
I just started working with xdebug myself due to problems with PHP 5.3.1. I had used PECL per instructions a couple weeks ago but it looks like phpize is the new black. I looked over the new instructions (generated from my phpinfo()) @ http://xdebug.org/find-binary.php
this is of note:
2 things:
have you checked that phpize is up to date?
if that doesnt work try these instructions: http://xdebug.org/docs/install