Amazon Web Services AWS EC2 PHP 5.6 Upgrade

I had PHP 5.3 by default but had to upgrade to PHP 5.6 in order to get CodeIgniter 3.X to work effectively.

Following steps helped me to perform the upgrade.

Stopping Apache

$ sudo service httpd stop

Removing old version of the Apche

$ sudo yum erase httpd httpd-tools apr apr-util

It’s good to note down the packages being removed by the above command.

Removing Old PHP

$ sudo yum remove php-*

Again, it’s good to note down the packges being removed by the above command.

Installing PHP 5.6 (Apache doesn’t need to be installed separately, as it will be automatically installed as part of it.)

$ sudo yum install php56

Verifying the packages installed to compare with the list of the packages removed earlier.

$ yum list installed | grep php

Now you can compare this list with the one you had noted above when uninstalling Old PHP. Identify the missing ones.

Following command lists all the modules available as part of PHP 5.6

$ yum search php56

This list will probably show lot of PHP packages which was not installed by default. Identify the ones you need and install accordingly

$ sudo yum install

Now you are all set to go with the PHP 5.6

Start the Apache service

$ sudo service httpd start

Apache started and when accessed my DNS through Browser it have me the default Apache home page.
Asking me to upload content to the /var/www/html folder.

Now I tried to copy the files from my local machine to the above directory path and said I don’t have permission. Following command allows ec2-user to write in the above directory.

$ sudo chown ec2-user /var/www/html

Leave a Reply

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

5 × = twenty