Skip to content

Installing PHP 5.4 on CentOS 5.8

This tutorial is intended for system administrators wanting to install PHP 5.4 on CentOS 5.8

The reader should know how to configure a web server or application server and have basic knowledge of the HTTP protocol. Once finished the reader should have PHP 5.4 running with the default configuration.

Install Yum Priorities

For a brief overview on and how to configure Yum Priorities you can follow the instructions outlined in our Install YUM Priorities on CentOS tutorial.

# yum install yum-priorities

Installing PHP 5.4 on CentOS 5.8 x86_64

Install the EPEL x86_64 YUM Repository

# rpm -Uvh http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

Install the IUS x86_64 YUM Repository

# rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-10.ius.el5.noarch.rpm
# yum install php54 php54-common php54-devel
# php -v
PHP 5.4.5 (cli) (built: Jul 23 2012 10:10:54)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

Installing PHP 5.4 on CentOS 5.8 i386

Install the EPEL i386 YUM Repository

# rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

Install the IUS i386 YUM Repository

# rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-10.ius.el5.noarch.rpm
# yum install php54 php54-common php54-devel
# php -v
PHP 5.4.5 (cli) (built: Jul 23 2012 10:10:54)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies