mac php phpize,MAC 下 phpize命令出错

在安装xdebug的时候,执行phpize命令,会出现如下报错

grep: /usr/include/php/main/php.h: No such file or directory

grep: /usr/include/php/Zend/zend_modules.h: No such file or directory

grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory

Configuring for:

PHP Api Version:

Zend Module Api No:

Zend Extension Api No:

————————————————————————————————————

网上有一个解决方法就是在终端输入

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include    /usr

但是这样执行有可能会没有效果,问题在于 ln命令是为某一个文件在另外一个位置建立一个同步的链接,而/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include这个地址应该是对应你的php所在的位置,如下图,我的php所在的位置是XAMPP下。

e90ad9625bed

所以命令中的/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include地址要改成对应的自己的地址/Applications/XAMPP/xamppfiles/include/

最后命令行为sudo ln -s /Applications/XAMPP/xamppfiles/include/  /usr

执行成功后就会在 /user下创建一个include文件的连接连接到对应的位置,然后再运行phpize命令就没有问题了。

e90ad9625bed

(如果出现Operation not permitted的提示,请参考这篇文章https://www.jianshu.com/p/22b89f19afd6)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值