# cat /etc/redhat-release CentOS release 6.3 (Final) # php -v PHP 5.3.3 # yum update php No Packages marked for Update
How do I upgrade to the latest version PHP 5.4.10 (Current stable) ?
You can use the remi repository, which provides PHP 5.4 as well as MySQL 5.5 and some other LAMP related stuff not available with CentOS base or EPEL. If you use this repository, I strongly recommend the yum-versionlock plugin to ensure that your version of PHP remains on the 5.4 branch.
You can use remi like Michael Hampton suggested, but for sake of completeness, you can also compile your own php.
You'll need basic development tools, and you should be able to get that through a group install.
You'll also need bunch of libraries to compile PHP. The following is a mere sample list. You may need to adjust depending on additional modules you are installing.
Another common library often used is mcrypt (
Once all the requirements are set, actual compilation is fairly simple.
Extract the php you downloaded earlier and enter directory.
Configure the PHP with stuff you want enabled.
You can see a full list of PHP configuration options here.
Then finalize with build.
Now you have php 5.4.* on your Centos 6.
Remi Dependency on CentOS 6 and Red Hat (RHEL) 6:
CentOS 6 and Red Hat (RHEL) 6:
Update your PHP:
CentOS 6.3/6.2/6.1/6/5.8 and Red Hat (RHEL) 6.3/6.2/6.1/6/5.8
Update your modules: