问题一:
执行 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:
解决方法:
$ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include /usr/include
PS:如果 sudo 授权后仍提示没有操作权限,请参考文章 macOS 中的 Rootless 机制 。
问题二:
执行 phpize 报错如下:
$ phpize Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
解决方法:
先安装 Homebrew :
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
然后安装 autoconf :
$ brew install autoconf
好
好吧