If you are operating a Linux server for your website and you wish to incorporate PHP support into it, here is the process. Unlike Red Hat and other distributions, they do not offer an RPM package for this. Instead, you can download it directly from the source or obtain it from a repository. In this case, we will proceed with configuration through the yum repository.

Now PHP 5.4.27 and  5.5.11 are available on Remi repository. You can find below Release Announcement for 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

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

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

For PHP 5.4 Installation

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

yum --enablerepo=remi update php\*

Below is the output for 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 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  Version through browser

(1) Upload the phpinfo 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 tag.

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

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

You can also check out our top free web hosting platform for easily managed web hosting. Additionally, you can handle software through these control panels.

By Sachin G

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! Sachin G Follow me on LinkedIn and x formerly twitter