mac MAMP php7.4.15 install extension pcntl

created at 12-30-2021 views: 13

Download php7.4.15

Download link: https://www.php.net/releases/

Replace the installation package, compile and install

The command is as follows:

tar -xzvf php-7.4.15.tar.gz
mv php-7.4.14 php
mkdir -p /Applications/MAMP/bin/php/php7.4.15/include
mv php /Applications/MAMP/bin/php/php7.4.15/include

Compile the pcntl.so file

cd ext/pcntl
/Applications/MAMP/bin/php/php7.4.15/bin/phpize
./configure --with-php-config=//Applications/MAMP/bin/php/php7.4.15/bin/php-config
make install 

Add the extension to the php.ini file

MAMP_apc_MAMPextension=apcu.so
MAMP_apc_MAMPextension=apc.so
extension=imap.so
extension=gettext.so
extension=pgsql.so
extension=pdo_pgsql.so
extension=pgsql.so

Check if the extension is successful

/Applications/MAMP/bin/php/php7.4.15/bin/php --ri pcntl
pcntl
pcntl support => enabled

Error 1

configure: error: in `/Applications/MAMP/bin/php/php7.4.15/include/php':
configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Solution

brew install pkg-config

Error 2

configure: error: Please specify the install prefix of iconv with --with-iconv=<DIR>

Solution

./configure --without-iconv

Error 3

/Applications/MAMP/bin/php/php7.4.15/include/php/ext/pcntl/pcntl.c:32:10: fatal error:'php.h' file not found

solution

sudo xcode-select --install

Error 4

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

solution

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
created at:12-30-2021
edited at: 12-30-2021: