安装pcntl扩展。
1.先看一下PHP版本:
/Applications/MxSrvs/bin/php/bin/php -v
2.然后去PHP: Releases下载对应版本的PHP压缩包,然后解压
cd ext/pcntl
然后
/Applications/MxSrvs/bin/php/bin/phpize
如果报错了
- Cannot find autoconf. Please check your autoconf installation and the
- $PHP_AUTOCONF environment variable. Then, rerun this script.
准备安装autoconf(如果有安装就不用这一步了)
brew install autoconf
如果brew也没有,执行:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
再次安装autoconfig
rew install autoconf
自动配置安装完成后,执行生成配置文件
/Applications/MxSrvs/bin/php/bin/phpize
然后挂载配置
./configure --with-php-config=/Applications/MxSrvs/bin/php/bin/php-config
然后安装:
make && make install
编辑php.ini文件,加入扩展pcntcl.so:
cd /Applications/MxSrvs/bin/php/etc
so文件在“/Applications/MxSrvs/bin/php/lib/php/extensions/no-debug-non-zts-20190902”目录下
- [pcntl]
- extension=/Applications/MxSrvs/bin/php/lib/php/extensions/no-debug-non-zts-20190902/pcntl.so