advice for php 5.6 with php 7 on ubuntu 16.04

looking to get all my old wordpress sites (v3.4.2) working on my newly installed ubuntu 16.04 box. it seems i need an older version of php to make that possible.

however i eventually want to upgrade those site to take advantage of the newer php release. plus, any new installs can use php 7 immediately. so a parallel installation of phps 5.6 and 7 seems to be the way to go.

atm hosting wordpress and zen cart sites are the only uses i have for php.

aside from ubuntu 16.04, im running virtualmin gpl installed from the script. my current setup (apache, mysql, php 7) already runs the latest wordpress version perfectly.

after much reading, it seems i need to perform the following commands to achieve my goal of parallel installations:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5.6

then its just a matter of choosing the older version for the applicable virtual servers.

however, ive also read that the aforementioned commands include/modify apache in some undesirable ways. being a recovering windows user and relative newb to linux, i thought i would run my plan past the experts for advice?

Newer versions of WordPress support PHP 7. I think it’s a good idea to upgrade your WordPress sites rather than trying to use a old php version.

as i said, im aware newer versions support php 7. also, php 5.6 is still supported. so no biggie there. there is also the issue of not all wp plugins supporting php 7 just yet.

so this topic isnt so much about whether i should parallel install, but how i should parallel install.

I know you’re trying to parallel install php 5 with php 7. I was just trying to help, developers upgrade their software for a reason, sometimes those are security reasons. People dumb enough not to use free upgrades could get hacked. And then they create even dumber topics than this saying I GOT HACKED, PLEASE HELP.

i think its pretty insensitive, this close to 9/11, that u keep trying to hijack my topic. :wink:

it seems that in addition to the commands above, the following is also required:

sudo apt-get install php5.6-cgi
sudo apt-get install php5.6-mysql

This is for CentOS 7.x . I wish it were that simple :slight_smile:

oh? its working on my ubuntu 16.04 box.

Thank you: this helped me out of a jam.

You do need to install the php5.6_cgi and the php5.6-mysql to make it work. as mentioned above:

apt install php5.6 php5.6-cgi php5.6-mysql

thank you, i have installed php 5.6, 7.0 & 7.1 on my ubuntu 16.04 server and works fine! but i have problemes to install PHP 5.3.29 - i know, php5.3 is old and a security risk, but i have one project it works only with 5.3… how can i install php5.3 on my ubuntu 16.04 server for virtualmin?? it is very important, i need help this WE.

i need only:
PHP 5.3.x (i need it!)
PHP 5.6.x (works!)
and for new projects only PHP7.0/7.1 (works!)