Ubuntu: How to install php 5.5.12 on lubuntu while installing lampstack?


I have installed apache and mysql according to this tutorial, but I need to install php 5.5.15 the $ sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql installs php 7.* .

How to do that?


To build php5.5.13

  1. Download the source file here or any other early version here

  2. Extract the tarball:

    tar -xzvf php.tar.gz  
  3. Change into the directory:

    cd php-5.5.13  
  4. Install depencies:

    sudo apt install build-dep php5  
  5. Configure php and add to /usr/local/php5513:

    ./configure --disable-debug --disable-rpath --enable-bcmath --enable-calendar -- enable-exif --enable-ftp --enable-fpm --enable-gd-native-ttf --enable-intl --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-pdo --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --enable-xmlreader --enable-xmlwriter --enable-zip -- prefix=/usr/local/php5513 --with-bz2 --with-config-file-path=/usr/local/php5513/etc --with-config-file-scan-dir=/usr/local/php5513/php.d --with-curl --with-freetype-dir=/usr/local/php5513 --with-gd --with-gettext --with-gmp --with-iconv --with-imap --with-imap-ssl --with-xpm-dir=/usr/local/php5513 --with-vpx-dir=/usr/local/php5513 --with-kerberos --with-libdir=lib64 --with-libxml-dir=/usr/local/php5513 --with-mcrypt --with-openssl --with-pcre-regex --with-pdo-mysql --with-pic --with-png-dir=/usr/local/php5513 --with-snmp --with-xmlrpc --with-xsl --with-zlib --without-gdbm --with-mysqli  
  6. Test it:

    make; make test    # Any errors please correct them  
  7. Install with:

    make install  
  8. Copy sample php.ini file and change as desired:

    cp php.ini-production /usr/local/php5513/etc/php.ini  


  1. To use other php configuration files do mkdir /usr/local/php5513/php.d/ and add them there.

  2. To configure php to your taste and needs take note of step 5. Remove and add as you desire.





To install Apache, PHP and MySQL, run:

sudo apt-get install php7 libapache2-mod-php7 php7-mcrypt  


sudo apt-get install php libapache2-mod-php php-mcrypt  


sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »