Skip to content

Instantly share code, notes, and snippets.

@girorme
Last active January 5, 2020 01:02
Show Gist options
  • Save girorme/099d8a42747ed7dc3ccfc1c38ce12ac6 to your computer and use it in GitHub Desktop.
Save girorme/099d8a42747ed7dc3ccfc1c38ce12ac6 to your computer and use it in GitHub Desktop.
php compile script with parallel
#!/bin/bash
#
# ** Need install system dependencies
rm -rf php-src/
mkdir -p /etc/php7
mkdir -p /etc/php7/cli
git clone https://github.com/php/php-src.git -b PHP-7.4.1 --depth=1
cd php-src/ext
git clone https://github.com/krakjoe/parallel
cd ..
./buildconf --force
./configure --prefix=/etc/php7 --with-bz2 --with-zlib --enable-zip --disable-cgi \
--enable-soap --enable-intl --with-mcrypt --with-openssl --with-readline --with-curl \
--enable-ftp --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
--enable-sockets --enable-pcntl --with-pspell --with-enchant --with-gettext \
--with-gd --enable-exif --with-jpeg-dir --with-png-dir --with-freetype-dir --with-xsl \
--enable-bcmath --enable-mbstring --enable-calendar --enable-json \
--enable-hash --enable-session --enable-wddx --enable-opcache \
--with-pcre-regex --with-config-file-path=/etc/php7/cli \
--with-config-file-scan-dir=/etc/php7/etc --enable-cli --enable-maintainer-zts \
--enable-fpm \
--with-fpm-user=www-data --with-fpm-group=www-data \
--with-libdir=/lib/x86_64-linux-gnu
make && make install
chmod o+x /etc/php7/bin/phpize
chmod o+x /etc/php7/bin/php-config
cd ext/parallel*
/etc/php7/bin/phpize
./configure --enable-parallel --with-php-config=/etc/php7/bin/php-config
make
make install
cd ..
cp -r php.ini-development /etc/php7/cli/php.ini
cp php.ini-development /etc/php7/cli/php-cli.ini
# echo "extension=parallel.so" >> /etc/php7/cli/php-cli.ini
ln --symbolic /etc/php7/bin/php /usr/bin/php
export USE_ZEND_ALLOC=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment