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

时间:2022-08-11 08:53:03

异常

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:

场景

mac下,执行 phpize 安装PHP扩展时报错

解决

依次执行下面两条命令, 安装header包

cd /Library/Developer/CommandLineTools/Packages/
// 不同的mac系统, 可能名字不一样
open macOS_SDK_headers_for_macOS_10.14.pkg