Skip to content

Instantly share code, notes, and snippets.

@jmeyo
Last active August 29, 2015 14:18
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 jmeyo/16f1b352b3b1c8b6251d to your computer and use it in GitHub Desktop.
Save jmeyo/16f1b352b3b1c8b6251d to your computer and use it in GitHub Desktop.
PHP oldversion compilation on ubuntu server
TMPDIR=$( mktemp -d 2>/dev/null )
cd $TMPDIR
VERSION=5.3.29 #latest php released stable version in 5.3.X
wget http://in1.php.net/distributions/php-$VERSION.tar.bz2
tar xvf php-$VERSION.tar.bz2
cd php-$VERSION
apt-get install libxml2-dev libcurl4-openssl-dev pkg-config libssl-dev libmcrypt-dev libmysqlclient-dev libbz2-dev libjpeg-dev libpng12-dev libxpm-dev libfreetype6-dev libpq-dev libmariadbclient-dev
./configure --prefix=/opt/php-$VERSION --with-pdo-pgsql --with-zlib-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --enable-ftp --without-imap --without-imap-ssl --with-kerberos --with-gettext --enable-fpm --with-libdir=/lib/x86_64-linux-gnu --with-libdir=lib
make -j9 # octocore
make install
# edit php.ini
# You may want to add: /opt/php-5.3.29/lib/php to your php.ini include_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment