By now you may know that PHP 7 has been available for quite some time now coming with a number of improvements over version 5. It may be wise to upgrade to PHP7 when running for instance a WordPress using Amazon AWS where you are responsible for any upgrades.
Also as of July 2016, Amazon officially added PHP7 to its repository so you can install it using
yum. So first thing I did was create a backup image of my EC2 instance before I went on with the upgrade. Once I had my backups done and proceeded with the PHP 7 upgrade.
Here are the steps I took in order to upgrade from PHP 5.x to 7.
Login to your Linux instance and perform the regular system updates first
sudo service httpd stop
Remove any existing PHP packages
sudo yum remove httpd*
yum package repository
sudo yum upgrade -y
Install Apache 2.4
sudo yum install php70 php70-mysqlnd php70-imap php70-pecl-memcache php70-pecl-apcu php70-gd
Install a new version of
service httpd start