Updating GoDaddy's PHP versions through SSH - php

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

Related

How can i downgrade the PHP 7.2.xx version to 7.1.XX or 7.0.xx on EC2 Linux 2

I am new to EC2. I have installed the latest php version which 7.2.22 . But my php files are in supported in latest version. So whether running the file in php in ec2 linux 2 its not working. So i have decide to downgrade php 7.2 to php 7.1.xx or php 7.0.xx.
How to Downgrade it. or else How can i uninstall php 7.2.xx and reinstall php 7.1.xx or php 7.0.xx
Please give the command to better understands and execute the commands to check.
Thanks in Advance...
I am instructing the command in ubuntu,
Command will differ wrt. to OS
Please purge the 7.2 php than Re-install 7.0 or 7.1
sudo apt-get purge php7.0-common
Install php 7.1
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1
Install php 7.0
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.0
Hope it helps .....!!!

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.

Vagrant Provision to Update to PHP 5.4 on Ubuntu 12.04 Only Works If Applied Manually

Using Vagrant with Ubuntu 12.04 I've tried provisioning using the Shell multiple ways on a new repository the most recent was this:
sudo apt-get update
sudo apt-get install -y python-software-properties
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y php5
It appears I can do this manually, but the only diff I can see is I can press [ENTER] to continue or ctrl-c to cancel when prompted during addition of ppa, and then running the upgrade asking for a new install of grub. Is there a way to have the script confirm install of ppa and during upgrade skip grub, or do whatever is needed without causing issues during provisioning?
As you have -y flag when installing package, you can do
sudo add-apt-repository -y ppa:ondrej/php5-oldstable
Options:
-y, --yes Assume yes to all queries

How to install PHP and a SQL database on a VPS?

I'd like to know a basic run down of command line inputs to install Apache, PHP and a SQL database on a VPS.
I'm not sure if sudo apt-get install php5 is enough to install php5 while getting the dependencies such as gcc.
I'm looking at Debian (Wheezy) as that is what a friend of mine suggested. I'm testing different websocket/wamp router solutions probably alongside if not dependent on node.js eg. socket.io or crossbar.io.
sudo apt-get install mysql-server
sudo apt-get install apache
sudo apt-get install php5-common libapache2-mod-php5 php5-cli
There are additional instructions for installing the mysql-server:
http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/

Categories