In this
article we learn how to install PHP 7.0,7.1 and 7.2 on centos 7 server.
PHP 5.4 is
available in centos 7 main repository . To install PHP 7.x we need to install
remi repository on the centos server. To do this we need to execute the below steps.
Installation Steps of PHP 7.0, 7.1 & 7.2 on CentOS 7 Server
To install remi
repo first we need to install EPEL repo and yum-utils .To install these
packages we need to execute the below command.
[root@localhost ~]#yum install epel-release yum-utils –y
After doing this we can
install remi repo using the below command.
[root@localhost ~]#yum install
http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Base on your requirement, configure the PHP
7.x repository
To configure PHP 7.0 repository,
execute below command,
[root@localhost ~]#yum-config-manager --enable remi-php70
To configure PHP 7.1 repository,
execute below command,
[root@localhost ~]#yum-config-manager --enable remi-php71
To configure PHP 7.2 repository,
execute below command
[root@localhost ~]#yum-config-manager --enable remi-php72
After doing the above
tasks we execute the below command to install the php packages.
[root@localhost ~]#yum install php php-common php-opcache
php-mcrypt php-cli php-gd php-curl php-mysql -y
To verify which php package
is installed to execute the below command.
[root@localhost ~]#php –v
PHP 7.0.33 (cli) (built: Dec
5 2018 14:22:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache
v7.0.33, Copyright (c) 1999-2017, by Zend Technologies
How to install PHP 7.0,7.1 and 7.2 on CentOS 7 server step by step guide. |
0 comments:
Post a Comment