温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

关于Mac安装PHP相关扩展出现Zend/zend_config.h缺失的问题记录

发布时间:2020-07-07 04:49:14 来源:网络 阅读:1936 作者:乄尐 栏目:web开发

Mac升级之后,系统自带的php版本也会随之升级,我用的就是系统自带的版本


麻烦的是扩展在版本变更后需要重新编译安装

重新安装redis  xdebug 等扩展时却会遇到各种头文件缺失的问题


之前从php官网下载php源码包解压之后,放到提示缺失文件的目录中,就可以解决这个问题。

后来也有自己重新编译覆盖安装过PHP,不过感觉都比较繁琐,...


常见的错误提示如下(redis)

In file included from /usr/include/php/main/php.h:35:

/usr/include/php/Zend/zend.h:51:11: fatal error: 'zend_config.h' file not found

# include <zend_config.h>

          ^

1 error generated.

make: *** [redis.lo] Error 1



网上搜索之后,从各种参考资源中发现了这个,感觉可以试试


I finally managed to install xdebug. In fact, I had to install Xcode developer tool and then copy the files from/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/php into /Applications/MAMP/bin/php/php5.4.4/include and then it worked !


于是在Xcode对应的目录看了看,确实有类似的目录存在。

拷贝至相应的目录后,编译安装通过。 仅以此备忘。


友情提示:   注意观察错误提示, 参考的资料与自己的情况通常都有差距,举一反三很重要 :)



向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI