Install 2 version of PHP

Today I got again problem with PHP 7 and PHP 5 for mysql_connect which is deprecated in PHP 7.

So, this is the way to install both version , and use it when require .
Apache:

sudo a2dismod [php old] ;
sudo a2enmod [php new] ;
sudo service apache2 restart

to update the php cli to use the specific version
CLI:
sudo update-alternatives –set php /usr/bin/[php new]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s