I am on php7 now but I have a legacy program relies on php5 as it is using mysql instead of mysqli.
Can I have php5 installed alongside with php7 and switch them around when either of them is needed?
I am on php7 now but I have a legacy program relies on php5 as it is using mysql instead of mysqli.
Can I have php5 installed alongside with php7 and switch them around when either of them is needed?
I know this post has been here for a long time but I would answer anyway.
You can install
php5
alongside.All you need to do is install
php5
.After installing it, you would have multiple folders holding the different version of your php version.
First start by adding Ondřej Surý PPA to install different versions of PHP – PHP 5.6, PHP 7.0 and PHP 7.1 on Ubuntu system.
Now you can install most required PHP modules from the list.
Install PHP Modules
To switch between the versions
First make sure you stop your apache2 service
I would suggest you run
phpinfo()
after the above steps to confirm the version running on your computer, if all went well, you should most likely get an error, as no php file would run.Enable e.g.
php5.6
Restart your apache2 service
check php version