对于在Mac上PHP 5.4.24能不能安装Xdebug 2.2.4?

黑白之上 发布于 2014/04/06 21:36
阅读 1K+
收藏 0

初学PHP,使用的是Mac自带的php 5.4.24,想单步调试,IDE提示安装Xdebug,都快安装成功,最后一步报错:

Mac-mini:~ hbzs$ php -v
Xdebug requires Zend Engine API version 220090626.
The Zend Engine API version 220100525 which is installed, is newer.
Contact Derick Rethans at http://xdebug.org/docs/faq#api for a later version of Xdebug.

根据提示,访问了http://xdebug.org/docs/faq#api,提示:

Q: What to do with: Xdebug requires Zend Engine API version xxxxxxxx. The Zend Engine API version 2xxxxxxxx which is installed, is newer.
A: This message means that you are trying to load Xdebug with a PHP version for which it wasn't built. If you compiled PHP yourself, it is most likely because you compiled Xdebug against PHP headers that belong to a different PHP version that you're running. For example, you're using PHP 5.3 and the headers you're using are still PHP 5.2. If you are using a pre-compiled binary, then you're using the wrong one.
To diagnose if this is your problem, make the following steps:
Check what the "Zend Extension" API number is of the PHP version that you are running by looking at phpinfo() (or "php -i") output. You can find it in the top part of the output, in the same block as the PHP logo and the PHP version. As examples, for PHP 5.2, the number is "220060519" and for PHP 5.3 it is "220090626".
Check what the output of "phpize" is when you're completing the compilation steps. The number that you're looking for is on the line that says "Zend Extension Api No".
If the two numbers from above do not match, you're compiling with the wrong PHP headers. Refer to the next FAQ entry to figure out which phpize to use.

我运行了下“phpize”,又提示:

Mac-mini:bin hbzs$ phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
然后我查询了一下,说是进入目录才能运行,可是没找到,现在有点不知所措了。


我还能安装Xdebug吗?不能的话,还能安装什么呢?还有别的单步调试工具么?



补充:谢谢@Eddy8的回答,我又试了下Xdebug2.2.3,phpize的显示:

Mac-mini:xdebug-2.2.3 hbzs$ phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

php -v还是显示的上面的结果,结合php -v给出的信息,是否可以说最新版的Xdebug所需要的“Zend Engine API”版本号低于Mac OS X 10.9自带的php 5.4.24的API版本,无法安装或者只能安装与Xdebug的“zend engine API”一致的低版本的PHP呢?难道以后升级PHP还必须等Xdebug更新才能单步调试,为什么这个功能这么第三方呢?明明很重要啊。有人在Mac 10.9上成功了么?一天多了,我快不行了,计划又要延期了,忧伤~~

一直编辑着,忘了提交,刚才安装homebrew又出问题,补刀太残忍,还讲不讲规矩了,能不能排个队先?

加载中
1
杨维杰
杨维杰
mamp 开启xdebug配置就好
0
Eddy8
Eddy8
源码编译安装时要注意: Make sure you use the phpize that belongs to the PHP version that you want to use Xdebug with.
Eddy8
Eddy8
回复 @黑白之上 : 版本不对,看下你系统有几个版本的phpize,找对后用绝对路径运行相应版本的phpize
黑白之上
黑白之上
@Eddy8 谢谢,phpize已经成功,Xdebug还是无法安装,求教
0
黑白之上
黑白之上

引用来自“杨维杰”的评论

mamp 开启xdebug配置就好

非常感谢,问题已解决。mamp的解决方案,给需要的人:
http://geek.michaelgrace.org/2011/08/xdebug-cachegrind-and-mamp-on-mac-osx/
http://confluence.jetbrains.com/display/PhpStorm/Installing+and+Configuring+MAMP+with+PhpStorm+IDE

黑白之上
黑白之上
后续补充:实在不甘心,又继续尝试,终于找到不装mamp的解决方案了:http://www.cnblogs.com/cndavidwang/p/3335846.html,讲的非常好,以后基本不担心插件安装了
返回顶部
顶部