This article describes how to install the PHP 5.4 on a CentOS 5 or CentOS 6 server  
  
1. First, detect if any PHP packages are installed:

![](http://cdn1.netmake.com.br/img_kb/en_us/setting_environment_manually_php_54_centos/01.png)

   If packages are installed remove them, for example:

![](http://cdn1.netmake.com.br/img_kb/en_us/setting_environment_manually_php_54_centos/02.png)  
  
2. Add PHP 5.4 packages to yum using this command for CentOS 5.x

![](http://cdn1.netmake.com.br/img_kb/en_us/setting_environment_manually_php_54_centos/03.png)  
  
    Or, for CentOS 6.x:

![](http://cdn1.netmake.com.br/img_kb/en_us/setting_environment_manually_php_54_centos/04.png)  
  
    Now, you can check if the new PHP (5.4: php54w ) packages are available:

![](http://cdn1.netmake.com.br/img_kb/en_us/setting_environment_manually_php_54_centos/05.png)  
     
    Or, version specific search:

![](http://cdn1.netmake.com.br/img_kb/en_us/setting_environment_manually_php_54_centos/06.png)  
3. Next, install the PHP 5.4 packages, for example when installing PHP 5.4 packages I used:

![](http://cdn1.netmake.com.br/img_kb/en_us/setting_environment_manually_php_54_centos/07.png)  
     
    PHP should now be upgraded to the new version, you can verify with the command:

![](http://cdn1.netmake.com.br/img_kb/en_us/setting_environment_manually_php_54_centos/08.png)  
  
4. Finally, restart the Web server:

![](http://cdn1.netmake.com.br/img_kb/en_us/setting_environment_manually_php_54_centos/09.png)