Installing php 5.2 ubuntu - php

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

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

"Gitpod" Downgrade default PHP v7.4.3 to 7.1.3 or 7.2

The error I'm facing is on Gitpod with PHP version, so the question is, how can I delete PHP completely from the workspace or replace it? Basically, I want to downgrade it.
I want to replace PHP with an older version. Unfortunately, I’m not able to get rid of the default PHP version 7.4 of the MySQL workspace.
I tried nearly every style of removing it in my .gitpod.Dockerfile file.
I activated the Feature Preview to have sudo support and I uninstalled every PHP version via gitpod dockerfile and ran
sudo apt-get purge ‘php*’
in the command line. It just says that no PHP is installed, but
whereis php
still gives me the output.
php -v
always gives me PHP v7.4
To install another php version is possible (e.g. with brew) but without removing the old one, I don’t know how I could use the new one.
Could someone please tell me, how can I downgrade this PHP version in "GITPOD" by replacing it or some other way?
Edit:
this was the code I was trying to run:
FROM gitpod/workspace-mysql
USER root
RUN sudo add-apt-repository ppa:ondrej/php
RUN sudo apt-get -y update
RUN sudo apt-get -y install php7.2
RUN sudo update-alternatives --set php /usr/bin/php7.2
RUN sudo a2dismod php7.4 RUN
sudo systemctl restart apache2
USER gitpod
Thanks in advance.
Best Regards
The problem is the install command. because of the script that runs in the background.
So the solution is running the following command instead of running apt-get install
install-packages php7.2
details of the answer could be found in the following thread:
Downgrade default PHP v7.4.3 to 7.1.3 or 7.2

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?

Updating GoDaddy's PHP versions through SSH

So I'm using GoDaddy (Deluxe/shared/linux) for hosting, but the PHP there only goes up to 5.3.2, and that's way too far back for me. I'd have to change so much of my project's code to get it to work with that version...
Is it possible to SSH into my server, and type something like:
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5
or would that just make a mess of things?
Try the following
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
sudo apt-get install php5
This will install PHP 5.4

Unable to install PHP 5.5

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.

Categories