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
[[email protected] ~]# 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 <[email protected]>
 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.

About Sachin Gupta

I am a professional freelance contributor and founder of tech transit. Love to write and lover of education, culture, and community. I have been using it, setting, supporting, and maintaining it since 2009.Linux rocks!

Have any Question or Comment?

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

Anonymous

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!

Reply
sabung ayam Online

Thanks for finally talking about > Install PHP Version ( 5.4 & 5.5 ) on Linux
( Cent OS, RHEL and Fedora ) < Loved it!

Reply

Leave a Reply

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