After trying a couple of packages, settings and configuration, the solution below is finally what worked for me:
NOTE: The above PPA is a co-installable one, meaning you can install PHP 5.5, PHP 5.6 or PHP 7.0 as per your requirement, and both your old and new versions of PHP can co-exist without you having to remove the old version.
1. Update your PPA repository with the PHP 7x package sources:
sudo add-apt-repository ppa:ondrej/php
Press enter to confirm. If you come across any error then you will need
to install the python-software-properties first as shown below:NOTE: The above PPA is a co-installable one, meaning you can install PHP 5.5, PHP 5.6 or PHP 7.0 as per your requirement, and both your old and new versions of PHP can co-exist without you having to remove the old version.
sudo apt-get update
sudo apt-get install python-software-properties
2. Update
Once again update your packages: sudo apt-get update
3. Install PHP 7.x and its relevant mods:
For PHP7.0: sudo apt-get install php7.0 php7.1-mbstring php7.0-mcrypt php7.0-mysql php7.0-xml php7.0-curl php7.0-intl php7.0-soap php7.0-zip php7.0-gd
For PHP7.1:
sudo apt-get install php7.1
sudo apt-get install php7.2
For PHP7.2:
4. Disable PHP 5.5 or 5.6:
Now this step is very important else you won't be able to use PHP 5.6. Even when you check your PHP version, it will still display as PHP 5.5. Follow the step below to disable PHP 5.5. sudo a2dismod php5
orsudo a2dismod php5.6
5. Enable PHP 7.x:
Note: Replace x with 0, 1 or 2, depending upon the version you want to install sudo a2enmod php7.x
6. Restart Apache web server:
sudo service apache2 restart
No comments:
Post a Comment
Thank you for your Feedback!
www.evagabond.me