Skip to content

Instantly share code, notes, and snippets.

@heathdutton
Forked from jbanety/build_pcntl.sh
Last active February 5, 2021 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heathdutton/3488ee8b6d7b094735d331bdebe05cda to your computer and use it in GitHub Desktop.
Save heathdutton/3488ee8b6d7b094735d331bdebe05cda to your computer and use it in GitHub Desktop.
Build PCNTL ext for MAMP PHP 7.2.10
# Command lines tools
xcode-select --install
# Install dependencies
brew install wget autoconf openssl libjpeg libpng lzlib curl imap-uw readline postgresql libxml2 mcrypt gettext libxslt homebrew/dupes/libiconv icu4c expat bison webp freetype
# Dirs
mkdir -p /Applications/MAMP/bin/php/php7.2.10/include
cd /Applications/MAMP/bin/php/php7.2.10/include
# Download PHP 7.2.10 sources
wget http://fr2.php.net/get/php-7.2.10.tar.bz2/from/this/mirror -O php-7.2.10.tar.bz2
# Extract
tar -xjvf php-7.2.10.tar.bz2
mv php-7.2.10 php
# Configure PHP
cd /Applications/MAMP/bin/php/php7.2.10/include/php/php-7.2.10
./configure --with-gd=shared --with-jpeg-dir=/usr/local/opt/jpeg --with-png-dir=/usr/local/opt/libpng --with-zlib --with-zlib-dir=/usr/local/opt/lzlib --with-freetype-dir=/usr/local/opt/freetype --prefix=/Applications/MAMP/bin/php/php7.2.10 --exec-prefix=/Applications/MAMP/bin/php/php7.2.10 --sysconfdir=/Applications/MAMP/bin/php/php7.2.10/conf --with-config-file-path=/Applications/MAMP/bin/php/php7.2.10/conf --enable-ftp --enable-gd-native-ttf --with-bz2=/usr --with-ldap --with-mysqli=mysqlnd --enable-mbstring=all --with-curl=/usr/local/opt/curl --enable-sockets --enable-bcmath --with-imap=shared,/usr/local/opt/imap-uw --enable-soap --with-kerberos --enable-calendar --with-pgsql=shared,/usr/local/opt/postgresql --enable-exif --with-libxml-dir=/usr/local/opt/libxml2 --with-gettext=shared,/usr/local/opt/gettext --with-xsl=/usr/local/opt/libxslt --with-pdo-mysql=mysqlnd --with-pdo-pgsql=shared,/usr/local/opt/postgresql --with-mcrypt=shared,/usr/local/opt/mcrypt --with-openssl=/usr/local/opt/openssl --enable-zip --with-iconv=/usr/local/opt/libiconv --enable-opcache --enable-intl --with-tidy=shared --with-icu-dir=/usr/local/opt/icu4c --enable-wddx --with-libexpat-dir=/usr/local/opt/expat --with-readline=/usr/local/opt/readline --with-mhash YACC=/usr/local/opt/bison/bin/bison --with-webp-dir=/usr/local/opt/webp
# Add MAMP's PHP binaries to PATH
export PATH=/Applications/MAMP/bin/php/php7.2.10/bin/:$PATH
# Phpize
cd /Applications/MAMP/bin/php/php7.2.10/include/php/php-7.2.10/ext/pcntl
phpize
# Build
./configure
make
# Install ext
cp modules/pcntl.so /Applications/MAMP/bin/php/php7.2.10/lib/php/extensions/no-debug-non-zts-20160303/
echo "extension=pcntl.so" >> /Applications/MAMP/bin/php/php7.2.10/conf/php.ini
@khanakia
Copy link

khanakia commented Feb 5, 2021

You can download the precompiled extensions from here https://github.com/khanakiaphp/mamp_extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment