mac MAMP php7.4.15 install extension pcntl

created at 12-30-2021 views: 13

Download php7.4.15

Download link:

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 file

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

Add the extension to the php.ini file

Check if the extension is successful

/Applications/MAMP/bin/php/php7.4.15/bin/php --ri 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.


brew install pkg-config

Error 2

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


./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


sudo xcode-select --install

Error 4

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


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