Centos7添加epel源并升级php

来源:互联网 发布:钢铁雄心4mac版汉化包 编辑:程序博客网 时间:2024/05/23 21:42

最近在阿里云上入手了一台centos7的服务器,在搭建环境过程中发现php的版本是5.4,且是最新的。可现在php都已经到7了,经查询发现centos为保持稳定性并没用太多的更新源,使得一些软件都过于老。因此为了使用到最新的php版本,我们得在centos中添加一些较新的源。目前在centos系统中较流行的源有epel和remi。接下来我们会添加这两种源来升级php版本。

一、安装源

rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm 
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

二、确认需要安装的php版本

yum list --enablerepo=remi --enablerepo=remi-php56 | grep php

三、卸载已经安装的php版本

如果系统中已经安装了较低的php版本,请先卸载掉

yun remove php*

四、安装较新的php版本

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

查看php版本

php -v
0 0
原创粉丝点击