Unable to install PHP 5.5 - php

I had LAMP Server installed on Ubuntu 12.10 with PHP 5.3. I had to remove it so i used this link.
Now I am trying to install LAMP with PHP 5.4 or higher using the ondrej ppa but i end up installing 5.3.10 again and again. I install using the below commands :
for 5.5 i tried,
sudo add-apt-repository ppa:ondrej/php5
and for 5.4 i tried,
sudo add-apt-repository ppa:ondrej/php5-oldstable
and then the regular update and install
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5
However in the end when i run php -v i see that the version installed is 5.3.10-1ubuntu3.19
I have tried restarting the web server. still noting changes. I dont know where it is going wrong.

Related

Would like a php version of php 8.1 for a specific virtual website

I have a virtual website in an ubuntu 18.04 server that is written in Laravel9 and it needs php version 8.0.2 or higher. The error looks like this in the browser:
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2".
In the system I have PHP 7.4.29 (cli) but can't change that due to other virtual sites who need 7.4.
How do I get php 8.1 to the Laravel9 site so it works?
Ok, found out that what was needed was a composer command:
composer install --ignore-platform-reqs
So now no error anymore. Now I have other things to worry about, but thats Laravel stuff.
My other sites works ok despite php 8.1 now.
Thanks any way for your help.
If using Debian/Ubuntu:
apt -y install software-properties-common
add-apt-repository ppa:ondrej/php
apt -y install php8.1
CentOS:
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf remove php* -y
dnf module list reset php -y
dnf module enable php:remi-8.1
dnf install php

Unable to install php 5.6 in ubuntu 14.04

I am trying to install php5.6 into my ubuntu 14.04 server.
Using following link
https://tecadmin.net/install-php5-on-ubuntu/
Using following Commands.
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php5.6
but getting following error.
"Unable to locate package php5.6"
"Couldn't find ant package by regex'php5.6' "
Please provide solution.
It was removed from repository. You can`t install it from ondrej/php repository
Ubuntu 14.04 (Trusty), PHP 5.6 and PHP 7.0 going away See also: Ubuntu 14.04 LTS reached end-of-life

Not able to install PHP 5.6 in Ubuntu 17.04

I have PHP 5.6 and PHP 7 installed on my laptop, but due to some libraries not working in PHP 5.6 (also not able to install them), I uninstall PHP 5.6 using sudo apt-get purge php5.6-common. Now I have a folder for PHP 5.6 inside of etc and PHP 5.6 contains mods_available folder (mods_available is empty). Now I am trying to install PHP 5.6` again and I tried following commands too many times but not able to do that.
sudo add-apt-repository ppa:ondrej/php
Please check output here.
Next sudo apt-get update, and I think this output is related to ondrej library
Then sudo apt-get -y install php5.6 AND also sudo apt-get install php5.6 output is here
Then sudo apt-get -y install php5.6-mysql output
Is there anyway I can install PHP 5.6?

Install php 5.3 or 5.4 on Ubuntu 16.04 Xenial and apache

I want to Install php 5.3 or 5.4 on Ubuntu 16.04 Xenial and Apache.
A tutorial points me to use PPA but they are not helping me in what I need.
I know that PHP 5.3 and 4 are obsolete but I need this for a project and is this possible? If yes then please teach me how in a step by step procedure with Apache2.
you can use this package ppa:sergey-dryabzhinsky/php53 to install php 5.3, i managed with this package on ubuntu 16.
sudo add-apt-repository ppa:sergey-dryabzhinsky/php53
sudo apt-get update
sudo apt-get install php5
Before installing PHP 5.4 you need to read this notice:
Security support for PHP 5.4 has ended. You are using this repository knowing that there might be and probably are unfixed security vulnerabilities. Please upgrade to PHP 5.6 or PHP 7.0 as found in the main repository: ppa:ondrej/php
After understanding the risks , to install PHP 5.4 ,add the PPA to your sources.list:
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
Install it:
sudo apt-get install -y php5
To be safe , the PHP 5.6 version can be installed as follows:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
Update
All version prior to PHP 5.6 are unsupported
This page lists the end of life date for each unsupported branch of PHP. If you are using these releases, you are strongly urged to upgrade to a current version, as using older versions may expose you to security vulnerabilities and bugs that have been fixed in more recent versions of PHP.
*reference for PHP 5.6 downgrade from PHP 7
Install add-apt-repository
sudo apt-get install python-software-properties
Add repository for PHP 5
sudo add-apt-repository -y ppa:ondrej/php
Update
sudo apt-get update
Install php5-fpm
sudo apt-get install php5.6-fpm
Move files
sudo mv /usr/bin/php /usr/bin/php7
sudo mv /usr/bin/php5.6 /usr/bin/php
Check PHP version
php -v
Restart Apache
sudo service apache2 restart
Try to use php version switcher: phpbrew.
Supported versions
While this may not answer your problem, but PHP-5 can be installed on ubuntu 14.04 (I have tried on Amazon EC2)
You can use
sudo apt‐get install php5 libapache2‐mod‐php5 php5‐mcrypt
sudo service apache2 restart
This will install 5.5.9 as on 25-Apr-2017.

Installing php 5.2 ubuntu

I want to install php 5.2.x on my server. I can't find any way to do this. I removed php from the server. My server is running ubuntu.
I tried to follow this one without success.
https://askubuntu.com/questions/262368/is-there-any-repository-for-installing-php-5-2-x-on-ubuntu-12-04
Try this:
sudo add-apt-repository ppa:txwikinger/php5.2
sudo apt-get update
then you should be able to install php5.2 with apt-get install but that's really old stuff now that PHP 7 has been released !
if that's not possible add these two lines to /etc/apt/sources.list add do a sudo apt-get update

Categories