Never Ending Study/LINUX&UNIX

Centos 7 에서 PHP7.2 로 업그레이드 하기

건방진참새 2020. 4. 14. 00:21

1. 우선 remi repository를 yum 에 추가 한다.

$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

$ rpm -Uvh epel-release-latest-7.noarch.rpm

$ wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm

$ rpm -Uvh remi-release-7.rpm

$ yum install -y yum-utils

$ yum-config-manager --enable remi-php72

 

2. 기존 설치된 PHP를 제거하고 7.2 버전을 설치

$ yum remove -y `yum list installed | cut -d " " -f 1 | grep php`

 

$ yum install –enablerepo=remi –enablerepo=remi-php56 php php-bcmath php-cli php-common php-devel php-gd php-mbstring php-mysql php-odbc php-pdo php-process php-xml php-xmlrpc 

 

$ yum install -y php-common php-fpm php-cli \

php-process \

php-opcache php-pecl-apcu \

php-mysqlnd php-pdo \

php-gd \

php-mbstring php-xml \

php-pecl-zip \

php-bcmath

 

$ yum install php72-php

 

$ yum update php-*

 

$ php -v

 

epel-release-latest-7.noarch.rpm
0.01MB
remi-release-7.rpm
0.02MB

출처: https://blog.asamaru.net/2018/02/14/install-php-7-2-on-centos-with-remi-rpm-repository/