Step 1: Install EPEL (Skip this if EPEL installed!)
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm
rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm
Step 2: Install the php repository setting
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7*.rpm
rpm -Uvh remi-release-7*.rpm
Step 3: Enable the repository
Open the setting file!
vim /etc/yum.repo.d/remi.repo
Then, find the setting and change 'enable=0' to 'enable=1'
[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/php56/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/7/php56/httpsmirror
mirrorlist=http://cdn.remirepo.net/enterprise/7/php56/mirror
# NOTICE: common dependencies are in "remi-safe"
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/php56/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/7/php56/httpsmirror
mirrorlist=http://cdn.remirepo.net/enterprise/7/php56/mirror
# NOTICE: common dependencies are in "remi-safe"
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Step 4: Remove current PHP
yum remove php-common
Step 5: Install new PHP
yum install php php-gd php-mysql php-mcrypt php-mbstring
when you install successfully, try 'php -v', it should look like this:
# php -v
PHP 5.6.35 (cli) (built: Mar 29 2018 07:28:25)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
PHP 5.6.35 (cli) (built: Mar 29 2018 07:28:25)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Step 6: Restart HTTP service (DON'T forget!)
service httpd restart
沒有留言:
張貼留言