Last active
September 5, 2017 07:59
-
-
Save mansurali901/fad69f76759007ccc58fe9a149aa2730 to your computer and use it in GitHub Desktop.
Install PHP 5.4.3 In UBUNTU and Debian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is used to install PHP 5.4.3 | |
# In UBUNTU and Debian | |
# Author : Mansur Ul Hasan | |
# Email : [email protected] | |
# Compile / Install PHP from Source | |
cd /usr/local/src | |
wget -O- https://s3-us-west-2.amazonaws.com/lamp-software/latest/php-5.4.33.tar.gz | tar -zxf - | |
cd php-5.4.33 | |
./configure \ | |
--prefix=/usr \ | |
--sysconfdir=/private/etc \ | |
--infodir=/usr/share/info \ | |
--mandir=/usr/share/man \ | |
--with-apxs2=/usr/local/apache2/bin/apxs \ | |
--enable-cli \ | |
--enable-fpm \ | |
--with-config-file-path=/etc \ | |
--enable-libxml=shared \ | |
--with-openssl=shared \ | |
--with-kerberos \ | |
--with-imap=shared,/usr/lib \ | |
--with-imap-ssl=shared,/usr/lib \ | |
--with-pcre-regex \ | |
--with-zlib=shared \ | |
--enable-bcmath=shared \ | |
--with-bz2=shared \ | |
--enable-calendar=shared \ | |
--enable-ctype=shared \ | |
--with-curl=shared \ | |
--enable-dba=shared \ | |
--enable-exif=shared \ | |
--enable-fileinfo=shared \ | |
--enable-ftp=shared \ | |
--with-gd \ | |
--with-jpeg-dir=/usr/local/lib \ | |
--with-png-dir=/usr/local/lib \ | |
--with-freetype-dir=/usr/lib \ | |
--enable-gd-native-ttf \ | |
--enable-gd-jis-conv \ | |
--with-gettext=shared \ | |
--with-mhash=shared \ | |
--with-icu-dir=shared \ | |
--enable-json=shared \ | |
--without-ldap \ | |
--without-ldap-sasl \ | |
--enable-mbstring=shared \ | |
--enable-mbregex \ | |
--with-mcrypt=shared \ | |
--enable-mysqlnd \ | |
--disable-mysqlnd-compression-support \ | |
--with-mssql=shared,/usr/local/freetds \ | |
--with-mysql=shared \ | |
--with-mysql-sock=shared,/var/lib/mysql/mysql.sock \ | |
--with-mysqli=shared \ | |
--without-iodbc \ | |
--enable-pdo=shared \ | |
--with-pdo-dblib=shared,/usr/local/freetds \ | |
--with-pdo-mysql=shared \ | |
--without-pdo-pgsql \ | |
--with-pdo-sqlite=shared \ | |
--without-pgsql \ | |
--enable-phar=shared \ | |
--with-libedit=shared \ | |
--with-readline=shared \ | |
--enable-shmop=shared \ | |
--enable-simplexml=shared \ | |
--without-snmp \ | |
--enable-soap=shared \ | |
--enable-sockets=shared \ | |
--enable-sysvmsg=shared \ | |
--enable-sysvsem=shared \ | |
--enable-sysvshm=shared \ | |
--with-tidy=shared \ | |
--enable-wddx=shared \ | |
--enable-xml=shared \ | |
--enable-xmlreader=shared \ | |
--with-xmlrpc=shared \ | |
--enable-xmlwriter=shared \ | |
--with-xsl=shared \ | |
--enable-zip=shared \ | |
--with-pear | |
make | |
make install | |
# Install MongoDB PHP Extension | |
cd /usr/local/src | |
wget -O- http://pecl.php.net/get/mongo-1.4.5.tgz | tar -zxf - | |
cd mongo-1.4.5 | |
phpize && ./configure && make && make install | |
# Install XDebug PHP Extension | |
cd /usr/local/src | |
wget -O- http://pecl.php.net/get/xdebug-2.2.3.tgz | tar -zxf - | |
cd xdebug-2.2.3 | |
phpize && ./configure && make && make install | |
# Move all the PHP Extensions to the extensions directory and remove the temp directory | |
mv /usr/lib/php/extensions/no-debug-non-zts-20100525/*.so /usr/lib/php/extensions/ | |
rm -rf /usr/lib/php/extensions/no-debug-non-zts-20100525 | |
# Download and place the configured php.ini file | |
cd /etc | |
wget https://gist.githubusercontent.com/sheikhwaqas/87ee16e1f6e4591b9daf/raw/293fbc23e65a7eb14540037c40548502568820cd/php.ini |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment