Home >Backend Development >PHP Tutorial >Centos7 adds epel source and upgrades php

Centos7 adds epel source and upgrades php

WBOY
WBOYOriginal
2016-07-25 08:46:231714browse

Centos7 adds epel source and upgrades php. Friends in need can refer to it.


Recently purchased a centos7 server on Alibaba Cloud. During the process of setting up the environment, I found that the version of php is 5.4, and it is the latest. But now PHP has reached 7. After inquiry, it was found that CentOS did not use too many update sources to maintain stability, making some software too old. Therefore, in order to use the latest php version, we have to add some newer sources to centos. Currently, the more popular sources in centos systems include epel and remi. Next we will add these two sources to upgrade the php version.

1. Installation source
  1. rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
Copy code
  1. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Copy code
2. Confirm the php version that needs to be installed
  1. yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
Copy code
3. Uninstall the installed php version

If a lower php version is already installed in the system, please uninstall it first

  1. yun remove php*
Copy code
4. Install a newer php version
  1. yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php -pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-common
Copy code
Check php version
  1. php -v
Copy code
epel, php


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn