升级Mac至11.0.1后执行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:
解决phpize问题后 顺便装个redis扩展
复制/usr/bin/phpize至/usr/local/include,修改line 8:
includedir="`eval echo ${prefix}/local/include`/php" # 注意local
复制/usr/bin/php-config至/usr/local/include,修改line 9:
include_dir="${prefix}/local/include/php"
创建目录
/usr/local/include/php
cp /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include/php/* /usr/local/include/php
修改扩展目录
vim /etc/php.ini
extension_dir = "/usr/local/lib/php/extensions"
重启php-fpm
killall php-fpm
下载phpredis扩展源码包
https://github.com/phpredis/phpredis
git clone git@github.com:phpredis/phpredis.git
进入phpredis目录执行:
/usr/local/include/phpize
./configure --with-php-config=/usr/local/include/php-config
sudo make
sudo make install
如果make后提示某文件不存在可以vim Makefile进行排查
make install 成功后redis.so将会移动至/usr/local/lib/php/extensions目录
vim /etc/php.ini
添加
extension=redis.so
kilall php-fpm
至此问题解决
git无法使用问题执行以下命令解决
xcode-select --install