Installing PHP 5.6 on Amazon Linux

Below are the steps I have used to update PHP version from 5.3 to 5.6 in Amazon Linux

Steps (Use sudo only if required)

1) Remove OLD Apache

sudo service httpd stop
sudo yum erase httpd httpd-tools apr apr-util

2) Remove OLD PHP

sudo yum remove php-*

3) Install PHP 5.6 (Apache 2.4 will be automatically installed with this)

sudo yum install php56

4) Make sure all the required PHP extensions are installed

yum list installed | grep php

5) If not then install them using

sudo yum install php56-xml php56-xmlrpc php56-soap php56-gd

6) To list the other available php extensions

yum search php56

7) PHP 5.6 MySQL extension (Assume you have already installed MySQL)

sudo yum install php56-mysqlnd 

(NOTE: it is not php56-mysql)

8) Start / Restart Apache

sudo service httpd start
sudo service httpd restart

9) Check the version

php -v
httpd -v
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Enabling SSL on Amazon Linux

For enabling SSL in Apache 2.4, run the following commandyum install mod24_ssl

Force redirection to SSL for websites

If you want to force your entire website to go through https, you can add these rules to your...

Increasing Attachment size in Zimbra

For increasing size of attachments to 50 MB in Zimbra, a few settings need to be altered as...