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?
42 Answers
To build php5.5.13
Download the source file here or any other early version here
Extract the tarball:
tar -xzvf php.tar.gzChange into the directory:
cd php-5.5.13Install depencies:
sudo apt install build-dep php5Configure 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-mysqliTest it:
make; make test # Any errors please correct themInstall with:
make installCopy sample
php.inifile and change as desired:cp php.ini-production /usr/local/php5513/etc/php.ini
Note:
To use other php configuration files do
mkdir /usr/local/php5513/php.d/and add them there.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-mcryptOr:
sudo apt-get install php libapache2-mod-php php-mcryptOr:
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt