对于在Mac上PHP 5.4.24能不能安装Xdebug 2.2.4?
初学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又出问题,补刀太残忍,还讲不讲规矩了,能不能排个队先?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
后续补充:实在不甘心,又继续尝试,终于找到不装mamp的解决方案了:http://www.cnblogs.com/cndavidwang/p/3335846.html,讲的非常好,以后基本不担心插件安装了
引用来自“杨维杰”的评论
mamp 开启xdebug配置就好
@Eddy8 谢谢,phpize已经成功,Xdebug还是无法安装,求教
回复
版本不对,看下你系统有几个版本的phpize,找对后用绝对路径运行相应版本的phpize
源码编译安装时要注意: Make sure you use the phpize that belongs to the PHP version that you want to use Xdebug with.
mamp 开启xdebug配置就好