Tuesday 29 October 2019

How to Install PHP 5.4 on CentOS 7



PHP is free and open source programming language. It is widely used Linux based system to write application. PHP package is available in CentOS 7 Base/default repositories:
This article describes How to Install PHP on CentOS 7 from CentOS 7 base/default repository.

Step 1. Search the package: Run the following command to list out the package using yum command on CentOS 7

[root@linuxcnf ~]# yum list php
Loaded plugins: fastestmirror, langpacks
………………………..
Available Packages
php.x86_64                                                                     5.4.16-46.el7                                                                     base
[root@linuxcnf ~]#

PHP 5.4.16 version is available for installation.

Step 2. Package Installation: Run the following command to install PHP 5.4 package and it's dependencies.

[root@linuxcnf ~]# yum install php -y
Loaded plugins: fastestmirror, langpacks
………………………..
Installed:
  php.x86_64 0:5.4.16-46.el7

Dependency Installed:
  libzip.x86_64 0:0.10.1-8.el7                        php-cli.x86_64 0:5.4.16-46.el7                        php-common.x86_64 0:5.4.16-46.el7

Complete!
[root@linuxcnf ~]#

Step 3. Verify the installation: Run the following command to verify the installation:

[root@linuxcnf ~]# php --version
PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
[root@linuxcnf ~]#

Done!!! PHP 5.4.16 is successfully Installed on CentOS 7.

1 comment: