- Download source code
wget http://cn.php.net/distributions/php-7.2.30.tar.xz
Note: You can also install through pecl install pcntl or pecl download pcntl , attached: download and install the pecl script cd /usr/local/php/bin/ curl -o go-pear.php http://pear.php.net/ go-pear.phar ./php go-pear.php
- Unzip
tar -xzvf php-7.2.30.tar.gz
- To the contents of pcntl extension
cd php-7.2.30/ext/pcntl
-
Compile
/Applications/MAMP/bin/php/php7.2.30/bin/phpize ./configure --prefix=/Applications/MAMP/bin/php/php7.2.30/bin/php --with-php-config=/Applications/MAMP/bin/php/php7.2.30/bin/php-config make && make install #输出类似下文 Installing shared extensions: /Applications/MAMP/bin/php/php7.2.30/lib/php/extensions/no-debug-non-zts-20170718/
-
Find out the location of the current PHP configuration file
php -i | grep Loaded # 输出 Loaded Configuration File => /Library/Application Support/appsolute/MAMP PRO/conf/php7.2.30.ini libXML Loaded Version => 20800 Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_caching_sha2_password,auth_plugin_sha256_password
It can be seen that the configuration file is:
/Library/Application Support/appsolute/MAMP PRO/conf/php7.2.30.ini
-
Edit the configuration file, add a line
extension=pcntl.so
- Check if the installation is successful
php --ri pcntl
PHP 7.2.30 install pcntl extension
Guess you like
Origin blog.csdn.net/JineD/article/details/113122709
Recommended
Ranking