Skip to content

Instantly share code, notes, and snippets.

@kelunik
Last active May 29, 2019
Embed
What would you like to do?
#!/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