昨天(也就是2018-09-25)新版本的macOS Mojave 10.14正式开放下载,我如此时尚,自然是要第一时间下载安装的(这句话好熟悉的样子)。
今天开发时发现有些PHP扩展无法使用,提示版本不兼容需要重新编译。
这个自然是难不倒我的,于是:下载扩展源码包、解压后进入文件夹、执行phpize报错了。。。。
$ 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:
缺少PHP的header头文件,再一看/usr/include
文件夹根本不存在,想必是Xcode command line tools
没有安装完全(我macOS 10.13版本装过的)?熟练的敲出如下命令:
$ xcode-select --install xcode-select: note: install requested for command line developer tools
静等了一会安装完成,一看/usr/include
文件夹还是不存在,难道升级系统后System Integrity Protection
自动打开导致文件写不进?接着执行: