Skip to content

Instantly share code, notes, and snippets.

@staabm
Last active August 29, 2015 14:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staabm/d95a5ee8296043fea30d to your computer and use it in GitHub Desktop.
Save staabm/d95a5ee8296043fea30d to your computer and use it in GitHub Desktop.
build php branch, incl. phpdbg
#!/bin/bash
if [ "$#" != "1" ]
then
echo "Usage: $0 <branch>"
exit 1;
fi
if [ $1 == "master" ]
then
VERSION="master"
NAME="php7"
else
VERSION=(${1//./ })
MAJOR=${VERSION[0]}
MINOR=${VERSION[1]}
BUGFIX=${VERSION[2]}
NAME="php"$MAJOR$MINOR
fi
cd php-src
if [ $1 == "master" ]
then
git checkout master
git pull
else
git fetch --tags
git checkout tags/php-$MAJOR.$MINOR.$BUGFIX
fi
./buildconf --force && \
./configure \
--prefix=/usr/local/$NAME \
--with-config-file-path=/etc/$NAME \
--with-libdir=/lib/x86_64-linux-gnu \
--disable-all \
--with-openssl \
--with-zlib \
--with-readline \
--enable-phpdbg \
--enable-sockets \
--enable-phar \
--enable-ctype \
--enable-hash \
--enable-json \
--enable-pcntl && \
sudo make clean && \
sudo make install > /dev/null
sudo mkdir /etc/$NAME
sudo cp -p -u php.ini-development /etc/$NAME/php.ini
sudo ln -f /usr/local/$NAME/bin/php /usr/local/bin/$NAME
sudo ln -f /usr/local/$NAME/bin/php-cgi /usr/local/bin/$NAME-cgi
sudo ln -f /usr/local/$NAME/bin/phpize /usr/local/bin/$NAME-phpize
sudo ln -f /usr/local/$NAME/bin/pecl /usr/local/bin/$NAME-pecl
sudo ln -f /usr/local/$NAME/bin/phar /usr/local/bin/$NAME-phar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment