ZIP扩展
https://pecl.php.net/package/zip 下载最新的 zip
phpize在 MAMP 的如下目录
/Applications/MAMP/bin/php/php7.2.22/bin/phpize
MAMP 可能会包含很多版本的 php,所以你需要添加参数–with-php-config告诉 phpize你要编译基于哪个php版本的扩展库。
./configure --with-php-config=/Applications/MAMP/bin/php/php7.2.22/bin/php-config
make && make install
目录下/Applications/MAMP/bin/php/php7.2.22/lib/php/extensions/no-debug-non-zts-20170718/查看到新生成的 zip.so
进入 MAMP Pro,文件 -> 编辑模板 -> php ,选择对应版本,打开 php.ini,找到 Extensions ,在最后一行加入 extension=zip.so ,保存。重启 Apache 后,可运行 phpinfo()查看 zip 是否加载成功。
pcntl 扩展(workerman需要)
wget http://cn.php.net/distributions/php-7.2.22.tar.gz
wget http://us.php.net/distributions/php-7.2.22.tar.gz
tar -zxvf php-7.2.22.tar.gz
cd php-7.2.22/ext/pcntl
/Applications/MAMP/bin/php/php7.2.22/bin/phpize
./configure --enable-pcntl --with-php-config=/Applications/MAMP/bin/php/php7.2.22/bin/php-config
make && make install
编辑php.ini文件,加入扩展pcntcl.so