Programming and accessibility tips

from the Cynthia Network

PHP »

Install PHP 5.5 on CentOS using rpm and yum

CentOS release 7.1 comes with PHP 5.4. CentOS release 6.7 comes with PHP 5.3. There are features in PHP that are new to version 5.5, some of which may be required by other packages. Here is the list of documented changes in PHP 5.5.

To install PHP 5.5 using rpm and yum in a CentOS system that has a previous version of PHP installed, there are two steps. First, upgrade the package files in the package manager rpm. Then, use yum to download and install the php55 packages.

Upgrade the package files

We will use the rpm package manager with the -U (upgrade) parameter. The locations of the package files to fetch are given below for each release:.

CentOS release 7

sudo rpm -U https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -U https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS release 6

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

CentOS release 5

sudo rpm -U http://mirror.webtatic.com/yum/el5/latest.rpm

Install the packages

Now that the package lists have been updated to contain links to the php55 packages, we can use yum to replace the current php packages with the php55 packages.

sudo yum install yum-plugin-replace
sudo yum replace php-common --replace-with=php55w-common

Finally, verify that PHP 5.5 is installed and running with:

php -v

Computer science help

Programming

User

By Bill Hollingsworth
© 2016 by Cynsight, LLC.
Cynthia™ is a trademark of Cynsight, LLC.

^