Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to install php 5.4 install on ubuntu desktop 12.04?

Tags:

php

ubuntu

I try to install php5 package with a specific version 5.4.

But I have problem and can not solve it myself. When I try to install :

"apt-get install php5=5.4.9-4ubuntu2"

It returns me an error:

E: Version '5.4.9-4ubuntu2' for 'php5' was not found.

How can I solve this task?

like image 634
Igor Khromov Avatar asked Aug 01 '13 20:08

Igor Khromov


People also ask

What version of PHP does Ubuntu 20.04 use?

Verify the installation of PHP on Ubuntu You can now see that version 7.4. 3 of PHP is installed on Ubuntu 20.04 LTS.


2 Answers

Add this ppa

sudo add-apt-repository ppa:ondrej/php

Then update and upgrade, upgrade will automatically install latest 5.4.x version of php

sudo apt-get update
sudo apt-get upgrade

Followed by,

sudo apt-get install -y php5.6

or

sudo apt-get install -y php7.2

depending on which version of PHP you want installed.


To install through Ubuntu software centre

php5 Install php5

(source: ubuntu.com)

Ref: https://askubuntu.com/questions/109404/how-do-i-install-latest-php-in-supported-ubuntu-versions-like-5-4-x-in-ubuntu-1

like image 147
Nagendra Rao Avatar answered Oct 05 '22 04:10

Nagendra Rao


If anyone is still looking to install php 5.4 and wants to create a stand-alone install of php 5.4 from source, this is how do do it:

Create a folder named php-5.4 in your local home directory like ~/programs/php-5.4. Then execute below commands from it through CLI.

  sudo apt-get install gcc libmysqlclient-dev libxml2-dev
  wget --trust-server-names http://museum.php.net/php5/php-5.4.15.tar.bz2
  tar xjf php-5.4.15.tar.bz2
  cd php-5.4.15
  ./configure --prefix=$PWD/installdir --enable-bcmath --with-mysql
  make install
  cd -

Replace 5.4.15 with the latest old-stable version of php. Refer this Google appengine developer page for more details.

edit

Updated the new location for php 5.4.

like image 37
Prahlad Yeri Avatar answered Oct 05 '22 04:10

Prahlad Yeri