M HYPE SPLASH
// general

How to install php 5.5.12 on lubuntu while installing lampstack?

By John Campbell

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?

4

2 Answers

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

Note:

  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.

Source:

To install Apache, PHP and MySQL, run:

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

Or:

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

Or:

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy