Setting environment manually PHP 5.4 - CentOS

Á

Álvaro Moura

Última actualización el Jul 6, 2026

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:

   If packages are installed remove them, for example:

  1. Add PHP 5.4 packages to yum using this command for CentOS 5.x

    Or, for CentOS 6.x:

    Now, you can check if the new PHP (5.4: php54w ) packages are available:


   
    Or, version specific search:


3. Next, install the PHP 5.4 packages, for example when installing PHP 5.4 packages I used:


   
    PHP should now be upgraded to the new version, you can verify with the command:

  1. Finally, restart the Web server: