mamplaravel-horizon

How to enable pcntl extensions in MAMP pro?


I am using laravel/horizon with Osx MAMP pro

when I run the composer it requires laravel/horizon:~1.0

it shows a message -

laravel/horizon v1.0.8 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.

I checked the folder /Applications/MAMP/bin/php7.1.1/php/ext,it doesn't contain pcntl extension.

How can I install that?


Solution

    1. download php from http://www.php.net/releases/
    2. tar -xzvf php-7.2.1.tar.gz
    3. cd php-7.2.1/ext/pcntl
    4. /Applications/MAMP/bin/php/php7.2.1/bin/phpize
    5. as @ drewjoh metioned ./configure --with-php-config=/Applications/MAMP/bin/php/php7.2.1/bin/php-config --prefix=/Applications/MAMP/bin/php/php7.2.1/bin/php
    6. make && make install
    7. the terminal shows

    Installing shared extensions: /Applications/MAMP/bin/php/php7.2.1/lib/php/extensions/no-debug-non-zts-20170718/

    1. open MAMP PRO menu->File ->Edit Template->PHP->7.2.1 add extension=pcntl.so at the end of the php.ini file .

    2. run the command php --ri pcntl and shows pcntl pcntl support => enabled