MAC 执行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:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
我的mac版本是10.15.3
解决:
xcode-select --install # 安装常用开发工具,如:git等。
sudo mount -uw / # 根目录挂载为可读写,否则无法在/usr/下建立文件,本修改重启前有效。
sudo ln -s "$(xcrun --show-sdk-path)/usr/include" /usr/include
export SDKROOT="$(xcrun --show-sdk-path)" # 设置环境变量
echo "export SDKROOT=\"\$(xcrun --show-sdk-path)\"" >> ~/.bash_profile # zsh的自行搞定
sudo DevToolsSecurity -enable # 将系统置于开发模式
xcode-select --install报错查看