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?
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.
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
(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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With