How to yum install php 7.1 from repo centos 6
Download epel release and remi repo
[root@localhost ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
--2018-10-12 19:13:43-- https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
Connecting to 192.168.71.17:9898... connected.
Proxy request sent, awaiting response... 200 OK
Length: 14540 (14K) [application/x-rpm]
Saving to: “epel-release-latest-6.noarch.rpm”
100%[============================================================================================>] 14,540 68.9K/s in 0.2s
2018-10-12 19:13:44 (68.9 KB/s) - “epel-release-latest-6.noarch.rpm” saved [14540/14540]
[root@localhost ~]#
[root@localhost ~]# wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
--2018-10-12 19:13:58-- http://rpms.remirepo.net/enterprise/remi-release-6.rpm
Connecting to 192.168.71.17:9898... connected.
Proxy request sent, awaiting response... 200 OK
Length: 14960 (15K) [application/x-rpm]
Saving to: “remi-release-6.rpm”
100%[============================================================================================>] 14,960 --.-K/s in 0s
2018-10-12 19:14:00 (840 MB/s) - “remi-release-6.rpm” saved [14960/14960]
[root@localhost ~]#
Install both packages
[root@localhost ~]# rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
warning: remi-release-6.rpm: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
warning: epel-release-latest-6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [ 50%]
2:remi-release ########################################### [100%]
[root@localhost ~]#
Install yum utils package
[root@localhost ~]# yum install yum-utils
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink | 55 kB 00:00
* base: centos.biz.net.id
* epel: del-repos.extreme-ix.org
* extras: centos.biz.net.id
* remi-safe: fr2.rpmfind.net
* updates: centos.biz.net.id
epel | 3.2 kB 00:00
epel/primary | 3.2 MB 00:01
epel 12516/12516
remi-safe | 2.9 kB 00:00
remi-safe/primary_db | 1.1 MB 00:01
Package yum-utils-1.1.30-42.el6_10.noarch already installed and latest version
Nothing to do
[root@localhost ~]#
Install the php package with enable remi repo as shown on following figure
[root@localhost ~]# yum --enablerepo=remi-php71 install php Loaded plugins: fastestmirror, security Setting up Install Process Loading mirror speeds from cached hostfile * base: centos.biz.net.id * epel: del-repos.extreme-ix.org * extras: centos.biz.net.id * remi-php71: fr2.rpmfind.net * remi-safe: fr2.rpmfind.net * updates: centos.biz.net.id Resolving Dependencies --> Running transaction check ---> Package php.x86_64 0:7.1.23-1.el6.remi will be installed --> Processing Dependency: php-common(x86-64) = 7.1.23-1.el6.remi for package: php-7.1.23-1.el6.remi.x86_64 --> Processing Dependency: php-cli(x86-64) = 7.1.23-1.el6.remi for package: php-7.1.23-1.el6.remi.x86_64 --> Processing Dependency: httpd-mmn = 20051115 for package: php-7.1.23-1.el6.remi.x86_64 --> Processing Dependency: httpd for package: php-7.1.23-1.el6.remi.x86_64 --> Running transaction check ---> Package httpd.x86_64 0:2.2.15-69.el6.centos will be installed --> Processing Dependency: httpd-tools = 2.2.15-69.el6.centos for package: httpd-2.2.15-69.el6.centos.x86_64 --> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-69.el6.centos.x86_64 ---> Package php-cli.x86_64 0:7.1.23-1.el6.remi will be installed ---> Package php-common.x86_64 0:7.1.23-1.el6.remi will be installed --> Processing Dependency: php-json(x86-64) = 7.1.23-1.el6.remi for package: php-common-7.1.23-1.el6.remi.x86_64 --> Running transaction check ---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed ---> Package httpd-tools.x86_64 0:2.2.15-69.el6.centos will be installed ---> Package php-json.x86_64 0:7.1.23-1.el6.remi will be installed --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================================== Package Arch Version Repository Size ====================================================================================================================================== Installing: php x86_64 7.1.23-1.el6.remi remi-php71 2.8 M Installing for dependencies: apr-util-ldap x86_64 1.3.9-3.el6_0.1 base 15 k httpd x86_64 2.2.15-69.el6.centos base 836 k httpd-tools x86_64 2.2.15-69.el6.centos base 81 k php-cli x86_64 7.1.23-1.el6.remi remi-php71 4.1 M php-common x86_64 7.1.23-1.el6.remi remi-php71 1.0 M php-json x86_64 7.1.23-1.el6.remi remi-php71 58 k Transaction Summary ====================================================================================================================================== Install 7 Package(s) Total download size: 8.9 M Installed size: 32 M Is this ok [y/N]: y Downloading Packages: (1/7): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm | 15 kB 00:00 (2/7): httpd-2.2.15-69.el6.centos.x86_64.rpm | 836 kB 00:00 (3/7): httpd-tools-2.2.15-69.el6.centos.x86_64.rpm | 81 kB 00:00 (4/7): php-7.1.23-1.el6.remi.x86_64.rpm | 2.8 MB 00:01 (5/7): php-cli-7.1.23-1.el6.remi.x86_64.rpm | 4.1 MB 00:02 (6/7): php-common-7.1.23-1.el6.remi.x86_64.rpm | 1.0 MB 00:01 (7/7): php-json-7.1.23-1.el6.remi.x86_64.rpm | 58 kB 00:00 -------------------------------------------------------------------------------------------------------------------------------------- Total 780 kB/s | 8.9 MB 00:11 warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi Importing GPG key 0x00F97F56: Userid : Remi Collet <[email protected]> Package: remi-release-6.9-3.el6.remi.noarch (installed) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi Is this ok [y/N]: y Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. Installing : php-json-7.1.23-1.el6.remi.x86_64 1/7 Installing : php-common-7.1.23-1.el6.remi.x86_64 2/7 Installing : php-cli-7.1.23-1.el6.remi.x86_64 3/7 Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 4/7 Installing : httpd-tools-2.2.15-69.el6.centos.x86_64 5/7 Installing : httpd-2.2.15-69.el6.centos.x86_64 6/7 Error unpacking rpm package httpd-2.2.15-69.el6.centos.x86_64 warning: /etc/httpd/conf/httpd.conf created as /etc/httpd/conf/httpd.conf.rpmnew warning: /etc/httpd/conf/magic created as /etc/httpd/conf/magic.rpmnew error: unpacking of archive failed on file /etc/httpd/logs: cpio: rename Installing : php-7.1.23-1.el6.remi.x86_64 7/7 Verifying : httpd-tools-2.2.15-69.el6.centos.x86_64 1/7 Verifying : php-7.1.23-1.el6.remi.x86_64 2/7 Verifying : php-common-7.1.23-1.el6.remi.x86_64 3/7 Verifying : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 4/7 Verifying : php-json-7.1.23-1.el6.remi.x86_64 5/7 Verifying : php-cli-7.1.23-1.el6.remi.x86_64 6/7 Verifying : httpd-2.2.15-69.el6.centos.x86_64 7/7 Installed: php.x86_64 0:7.1.23-1.el6.remi Dependency Installed: apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 httpd-tools.x86_64 0:2.2.15-69.el6.centos php-cli.x86_64 0:7.1.23-1.el6.remi php-common.x86_64 0:7.1.23-1.el6.remi php-json.x86_64 0:7.1.23-1.el6.remi Failed: httpd.x86_64 0:2.2.15-69.el6.centos Complete! [root@localhost ~]#
Check php version
[root@localhost ~]# php -v
PHP 7.1.23 (cli) (built: Oct 10 2018 12:25:46) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
[root@localhost ~]#
Check the php modules
[root@localhost ~]# php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
openssl
pcntl
pcre
Phar
readline
Reflection
session
sockets
SPL
standard
tokenizer
zlib
[Zend Modules]
[root@localhost ~]#
If you want php work with your apache server, you have to install mod php, the php71-php-embedded package contains a library which can be embedded into applications to provide PHP scripting language support
[root@sipencatar-cloud ~]# yum --enablerepo=remi-php71 install php-embedded
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: centos.biz.net.id
* epel: del-repos.extreme-ix.org
* extras: centos.biz.net.id
* remi-php71: fr2.rpmfind.net
* remi-safe: fr2.rpmfind.net
* updates: centos.biz.net.id
Resolving Dependencies
--> Running transaction check
---> Package php-embedded.x86_64 0:7.1.23-1.el6.remi will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================
Installing:
php-embedded x86_64 7.1.23-1.el6.remi remi-php71 1.4 M
Transaction Summary
======================================================================================================================================
Install 1 Package(s)
Total download size: 1.4 M
Installed size: 4.4 M
Is this ok [y/N]: y
Downloading Packages:
php-embedded-7.1.23-1.el6.remi.x86_64.rpm | 1.4 MB 00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-embedded-7.1.23-1.el6.remi.x86_64 1/1
Verifying : php-embedded-7.1.23-1.el6.remi.x86_64 1/1
Installed:
php-embedded.x86_64 0:7.1.23-1.el6.remi
Complete!
[root@sipencatar-cloud ~]#
You can install additional module or package if you need more
For example you can running following command
[root@localhost ~]# yum --enablerepo=remi-php71 install php-pdo php-mcrypt php-xml php-mysqlnd php-opcache php-gd
Tidak ada komentar :
Posting Komentar