Replace PHP on centos 6 to php 5.6

Last modified: July 30, 2020
You are here:
Estimated reading time: < 1 min

CentOS 6 has support until 2020, however scripts like magneto are starting to require newer PHP versions.

Using webtatic.com RPM repo you can update your server to PHP 5.6.

Difficulty medium. If you have live data it is recommended to contact support for this upgrade for assistance.

1) install the RPM from webtatic

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

2) get a list of current PHP rpm’s.

rpm -a | grep -i ^php

Keep this list, as you will want to match the RPM list after uninstalling PHP and upgrading to php 5.6.

3) Remove the old rpm’s (this varies based on what you have installed)
yum remove php-common php php-gd php-xml

4) Install PHP 5.6 (below is listed the most common modules, adjust as needed)

yum install -y php56w php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring

5) restart apache

service restart httpd
Was this article helpful?
Dislike 0
Views: 20