How to Install php 5.3 on CentOS or RHEL

In this guide, i will show you how to install php 5.3 installation using webtatic repository. This steps has been tested on CentOS 5.5 64 bit. However, it same goes to 32 bit OS on CentOS or RHEL.

To install basic php packages, please use this yum command:

    [root@server /]# yum --enablerepo=webtatic install php
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: ftp.oss.eznetsols.org
     * base: ftp.oss.eznetsols.org
     * extras: ftp.oss.eznetsols.org
     * updates: ftp.oss.eznetsols.org
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package php.x86_64 0:5.3.5-1.1.w5 set to be updated
    --> Processing Dependency: php-cli = 5.3.5-1.1.w5 for package: php
    --> Processing Dependency: php-common = 5.3.5-1.1.w5 for package: php
    --> Running transaction check
    ---> Package php-cli.x86_64 0:5.3.5-1.1.w5 set to be updated
    ---> Package php-common.x86_64 0:5.3.5-1.1.w5 set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================
     Package            Arch           Version               Repository        Size
    ================================================================================
    Installing:
     php                x86_64         5.3.5-1.1.w5          webtatic         1.3 M
    Installing for dependencies:
     php-cli            x86_64         5.3.5-1.1.w5          webtatic         2.5 M
     php-common         x86_64         5.3.5-1.1.w5          webtatic         567 k
    
    Transaction Summary
    ================================================================================
    Install       3 Package(s)
    Upgrade       0 Package(s)
    
    Total download size: 4.3 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/3): php-common-5.3.5-1.1.w5.x86_64.rpm                | 567 kB     00:00
    (2/3): php-5.3.5-1.1.w5.x86_64.rpm                       | 1.3 MB     00:00
    (3/3): php-cli-5.3.5-1.1.w5.x86_64.rpm                   | 2.5 MB     00:00
    --------------------------------------------------------------------------------
    Total                                           8.8 MB/s | 4.3 MB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : php-common                                               1/3
      Installing     : php-cli                                                  2/3
      Installing     : php                                                      3/3
    
    Installed:
      php.x86_64 0:5.3.5-1.1.w5
    
    Dependency Installed:
      php-cli.x86_64 0:5.3.5-1.1.w5         php-common.x86_64 0:5.3.5-1.1.w5
    
    Complete!
    

To install the php packages that will integrate with MySQL and will manage through phpMyAdmin, please follow below yum command:

    [root@server /]# yum --enablerepo=webtatic install php php-mbstring php-common 
    php-pdo php-mysql php-cli php-mcrypt php-gd
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: ftp.oss.eznetsols.org
     * base: ftp.oss.eznetsols.org
     * extras: ftp.oss.eznetsols.org
     * updates: ftp.oss.eznetsols.org
    addons                                                   |  951 B     00:00
    base                                                     | 2.1 kB     00:00
    extras                                                   | 2.1 kB     00:00
    updates                                                  | 1.9 kB     00:00
    webtatic                                                 |  951 B     00:00
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package php.x86_64 0:5.3.5-1.1.w5 set to be updated
    ---> Package php-cli.x86_64 0:5.3.5-1.1.w5 set to be updated
    ---> Package php-common.x86_64 0:5.3.5-1.1.w5 set to be updated
    ---> Package php-gd.x86_64 0:5.3.5-1.1.w5 set to be updated
    ---> Package php-mbstring.x86_64 0:5.3.5-1.1.w5 set to be updated
    ---> Package php-mcrypt.x86_64 0:5.3.5-1.1.w5 set to be updated
    ---> Package php-mysql.x86_64 0:5.3.5-1.1.w5 set to be updated
    ---> Package php-pdo.x86_64 0:5.3.5-1.1.w5 set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================
     Package             Arch          Version                Repository       Size
    ================================================================================
    Installing:
     php                 x86_64        5.3.5-1.1.w5           webtatic        1.3 M
     php-cli             x86_64        5.3.5-1.1.w5           webtatic        2.5 M
     php-common          x86_64        5.3.5-1.1.w5           webtatic        567 k
     php-gd              x86_64        5.3.5-1.1.w5           webtatic        107 k
     php-mbstring        x86_64        5.3.5-1.1.w5           webtatic        1.2 M
     php-mcrypt          x86_64        5.3.5-1.1.w5           webtatic         30 k
     php-mysql           x86_64        5.3.5-1.1.w5           webtatic         90 k
     php-pdo             x86_64        5.3.5-1.1.w5           webtatic         64 k
    
    Transaction Summary
    ================================================================================
    Install       8 Package(s)
    Upgrade       0 Package(s)
    
    Total download size: 5.7 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/8): php-mcrypt-5.3.5-1.1.w5.x86_64.rpm                |  30 kB     00:00
    (2/8): php-pdo-5.3.5-1.1.w5.x86_64.rpm                   |  64 kB     00:00
    (3/8): php-mysql-5.3.5-1.1.w5.x86_64.rpm                 |  90 kB     00:00
    (4/8): php-gd-5.3.5-1.1.w5.x86_64.rpm                    | 107 kB     00:00
    (5/8): php-common-5.3.5-1.1.w5.x86_64.rpm                | 567 kB     00:00
    (6/8): php-mbstring-5.3.5-1.1.w5.x86_64.rpm              | 1.2 MB     00:00
    (7/8): php-5.3.5-1.1.w5.x86_64.rpm                       | 1.3 MB     00:00
    (8/8): php-cli-5.3.5-1.1.w5.x86_64.rpm                   | 2.5 MB     00:00
    --------------------------------------------------------------------------------
    Total                                           8.2 MB/s | 5.7 MB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : php-common                                               1/8
      Installing     : php-cli                                                  2/8
      Installing     : php-pdo                                                  3/8
      Installing     : php-mcrypt                                               4/8
      Installing     : php-mbstring                                             5/8
      Installing     : php                                                      6/8
      Installing     : php-mysql                                                7/8
      Installing     : php-gd                                                   8/8
    
    Installed:
      php.x86_64 0:5.3.5-1.1.w5               php-cli.x86_64 0:5.3.5-1.1.w5
      php-common.x86_64 0:5.3.5-1.1.w5        php-gd.x86_64 0:5.3.5-1.1.w5
      php-mbstring.x86_64 0:5.3.5-1.1.w5      php-mcrypt.x86_64 0:5.3.5-1.1.w5
      php-mysql.x86_64 0:5.3.5-1.1.w5         php-pdo.x86_64 0:5.3.5-1.1.w5
    
    Complete!
    

How to Reset the Directory Manager Password on RHEL 7 / CentOS 7
How to Reset the Directory Manager Password on RHEL 7 / CentOS 7

It is best practice to remember passwords, but because too many passwords, sometimes we forget. We are not encouraged to write the password on any paper or share the password...

How to Find Big Files Size on Linux RHEL/CentOS
How to Find Big Files Size on Linux RHEL/CentOS

As the linux administrator, sometimes we have to identify which files are most take much space in the linux server resulting in low free space. Low disk space can also...

Why Linux users should worry about malware and what they can do about it
Why Linux users should worry about malware and what they can do about it

Don’t drop your guard just because you’re running Linux. Preventing the spread of malware and/or dealing with the consequences of infection are a fact of life when using computers. If...

How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7
How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7

This short howto will explain the steps to reset a lost root password or to reset a forgotten root password on Linux RHEL 7 or CentOS 7. Basically, we will...

How to Update CentOS or Upgrade CentOS to the Latest Version
How to Update CentOS or Upgrade CentOS to the Latest Version

Recently, the latest version of CentOS 7.3 was released. All users of CentOS 7.0, 7.1 and 7.2 can upgrade their system to the most recent. This quick guide will explain...

How to Change your WordPress Username, Nickname and Display Name in MySQL
How to Change your WordPress Username, Nickname and Display Name in MySQL

After you create an account log in WordPress, you may want to change your WordPress username, as appropriate or due to security reason. However, you can not do this from...

How to Enable SSH Root Login on Ubuntu 16.04
How to Enable SSH Root Login on Ubuntu 16.04

As what we wrote in the previous article on how to allow SSH root on Ubuntu 14.04, after installing a fresh new copy of Ubuntu 16.04 LTS, we find that...

How to Change UUID of Linux Partition on CentOS 7
How to Change UUID of Linux Partition on CentOS 7

UUID (Universally Unique IDentifier) should be unique and it is used to identify storage devices on a linux system. If you cloned a virtual machine from vCenter, the metadata containing...

Leave a Reply

Your email address will not be published. Required fields are marked *