Home / Linux  / Install PHP Version ( 5.4 & 5.5 ) on Linux ( CentOS, RHEL and Fedora )

Install PHP Version ( 5.4 & 5.5 ) on Linux ( CentOS, RHEL and Fedora )

If you are running linux server for your website and Now you want to add PHP support into it . Here’s how Red hat and other distribution not provide RPM package for php , you can download from source or download repository for it, we are configuration through yum repository.

Now PHP 5.4.27 and PHP 5.5.11 are available on Remi repository. You can find below Release Announcement for PHP Version Releases.

PHP 5.5.11 Release Annoucement

PHP 5.4.27 Release Annoucement

Download and configuration Remi repoisitory for Centos 6.x

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm  rpm -Uvh remi-release-6*.rpm
[root@techtransit.org ~]# rpm -Uvh remi-release-6.rpm  warning: remi-release-6.rpm: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY  Preparing...                ########################################### [100%]     1:remi-release           ########################################### [100%]

That command will install the Remi repo inside your /etc/yum.repos.d directory.The above steps will install remi repo into the yum repository path ( /etc/yum.repos.d ) . Edit the remi repository file and changes some variables enabled from 0 to 1.

Example:

enabled=0
enabled=1

For PHP 5.5 Installation

For php 5.5 installation , use below command to install or update php version.

yum --enablerepo=remi-php55,remi update php\*

For PHP 5.4 Installation

For php 5.4 installation , use below command to install or update php version.

yum --enablerepo=remi update php\*

Below is the output for PHP updation from linux terminal.

================================================================================   Package              Arch       Version                    Repository     Size  ================================================================================  Updating:   php                  i686       5.4.27-1.el6.remi          remi          2.7 M  .  .  .  .  Transaction Summary  ================================================================================  Install       2 Package(s)  Upgrade      11 Package(s)   .  .  .  Importing GPG key 0x00F97F56:   Userid : Remi Collet <RPMS@FamilleCollet.com>   Package: remi-release-6.5-1.el6.remi.noarch (installed)   From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi  Is this ok [y/N]: y  .  .  .  Updated:    php.i686 0:5.4.27-1.el6.remi

Check PHP Version through Linux Terminal

To Check PHP Version installed from linux terminal , use below command in linux terminal.

php -i

to get alot of info or

php -v

Check PHP Version through browser

(1) Upload the php info file to the server. You should upload your file to the exact directory you want to test. Typically, this will be website path.

Add phpinfo() function in php tag.

(2) Visit the page in your browser. http://www.example.com/phpinfo.php, replacing techtransit.org with your own domain name.

(3) Now you can see information about PHP for your server for that particular directory.

A Linux Geek with Freelance Contributor, Server/ Cloud Administrator having 6+ Years experience in Open Source and Cloud Technologies.

Review overview
1 COMMENT
  • Anonymous October 7, 2014

    Wonderful website. A lot of useful information here. I’m sending
    it to some friends ans also sharing in delicious. And certainly, thanks for your effort!

POST A COMMENT