in OS by (10.8k points) edited by
0 like 0 dislike
47 views

How I can install PHP 5.3.10 on GNU/Linux Ubuntu 16.04 OS? In official repository, by default, are only new version of PHP 7, but me need PHP 5.3.10.


ubuntu install php 5.3.10
install old version php on ubuntu

1 Answer

0 like 0 dislike
by (10.8k points)

There are many ways to solve this problem. Consider the options presented for downgrading PHP, and select the most suitable.


Install PHP of the old version from other repositories where it is, or directly from the installation packages:

apt-get install php53-apache2 php53-mod-pdo php53-mod-mysql php53-mod-mysqlnd php53-mod-pgsql php53-mod-sqlite
apt-get install php53-mod-pdo php53-mod-mysql php53-mod-mysqlnd php53-mod-pgsql php53-mod-sqlite
apt-get install php53-mod-mysql php53-mod-mysqlnd php53-mod-pgsql php53-mod-sqlite
apt-get install php53-mod-mysqlnd

Update your repositories:

sudo apt-get update

Download and install from repositories:

sudo apt-get install php5 php5-common php5-cli php5-dev php5-mysql phpmyadmin php5-pgsql phppgadmin php5-gd php5-mcrypt php5-curl php-pear libapache2-mod-php5 php5-xdebug php5-codesniffer

You can also download PHP 5.3.10 from here:

Install:

dpkg -i php5-gd5.3.10-1ubuntu3.15i386.deb

If you get any configuration errors, depending on the errors you should install the dependencies: http://zgadzaj.com/how-to-install-php-53-and-52-together-on-ubuntu-1204


You can build it yourself from the source:

wget http://in1.php.net/distributions/php-5.3.29.tar.bz2
tar -xvf php-5.3.29.tar.bz2
cd php-5.3.29
./configure
make
make test # Neither mandatory nor a bad idea.
sudo make install

Install another default repository (ppa:eugenesan/ppa) and take PHP 5 from there:

sudo add-apt-repository ppa:eugenesan/ppa
sudo apt-get update
sudo apt-get install php5

Install from file:

dpkg -i <deb file>
apt-get install -f

or

dpkg -i /path/to/filename.deb
sudo apt-get -f install

Your answer

Try to answer the question as detailed as possible.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.