Skip to content

Instantly share code, notes, and snippets.

@kelunik
Last active May 29, 2019 08:31
Show Gist options
  • Save kelunik/4e137a8d1ea30408c4d7 to your computer and use it in GitHub Desktop.
Save kelunik/4e137a8d1ea30408c4d7 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
set -x
if [ $1 == "master" ]
then
wget https://github.com/php/php-src/archive/master.zip -O master.zip
rm -rf php-src-master
unzip -q master.zip
rm -rf release
mv php-src-master release
elif [ $1 == "jit" ]
then
wget https://github.com/zendtech/php-src/archive/jit-dynasm.zip -O jit-dynasm.zip
rm -rf php-src-jit-dynasm
unzip -q jit-dynasm.zip
rm -rf release
mv php-src-jit-dynasm release
elif [ ${#1} == 40 ]
then
wget https://github.com/php/php-src/archive/$1.zip -O $1.zip
rm -rf php-src-$1
unzip -q $1.zip
rm -rf release
mv php-src-$1 release
else
wget https://github.com/php/php-src/archive/php-$1.zip -q -O $1.zip
rm -rf php-src-php-$1
unzip -q $1.zip
rm -rf release
mv php-src-php-$1 release
fi
cd release
# wget https://github.com/krakjoe/pthreads/archive/master.zip -q -O pthreads.zip
# rm -rf pthreads-master ext/pthreads
# unzip pthreads.zip
# mv pthreads-master ext/pthreads
./buildconf --force
echo "buildconf successful"
./configure \
--prefix=$HOME/.phpenv/versions/$1 \
--with-config-file-path=/etc/php \
--enable-phpdbg \
--with-libdir=/lib/x86_64-linux-gnu \
--disable-all \
--with-pdo-mysql \
--with-openssl \
--with-zlib \
--with-curl \
--with-xsl \
--with-gd \
--with-iconv \
--with-readline \
--with-bz2 \
--enable-opcache \
--enable-bcmath \
--enable-pdo \
--enable-fileinfo \
--enable-sockets \
--enable-mbstring \
--enable-phar \
--enable-ctype \
--enable-hash \
--enable-json \
--enable-filter \
--enable-zip \
--enable-pdo \
--enable-xml \
--enable-libxml \
--enable-simplexml \
--enable-xmlreader \
--enable-xmlwriter \
--enable-dom \
--enable-intl \
--enable-tokenizer \
--enable-posix \
--enable-pcntl
make install -j4 > /dev/null
cd ..
rm -rf release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment