How to Upgrade PHP 5.5 to 5.6

I had an issue upgrading php from version 5.5 to 5.6 for my new wordpress plugin. Even after the installation has been completed and php -v command shows the new version of php, wordpress says that the host is still running with the old version.

*Host OS version: Ubuntu 14.04.5 LTS

Solution:
After installing php 5.6, disable old php version, enable new version and then restart apache2.

$ sudo apt-add-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get -y install php5.6 php5.6-fpm php5.6-mcrypt php5.6-mbstring php5.6-ssh2 php5.6-curl php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl php5.6-zip libapache2-mod-php5.6
$ sudo a2dismod php5
$ sudo a2enmod php5.6
$ sudo service apache2 restart

 

Leave a Reply

Your email address will not be published. Required fields are marked *