yum安装php7

WBOY
Release: 2016-06-20 12:28:46
Original
904 people have browsed it

目前一般VPS上配置的 yum repo 都是不支持安装php7的,所以需要我们去编译源码,安装依赖的扩展也要编译安装,所以这样子就非常麻烦,但是一个来自法国的PHP开发者,自己维护了一个 提供最新php7编译版本的yum源,直接配置这个源,我们就可以安装最新版本的php7了。

Centos7上的配置方式:

# yum install epel-release# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

Centos6 上的配置方式;

# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

在配置好了之后,在安装php7的时候,需要指定源,就像这样;

# yum install  –enablerepo=remi-php70  -y php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd

这个就是安装php7和它的扩展的示例,安装php5.6 就换成–enablerepo=remi-php56,在安装之前,你可以使用 yun info –enablerepo=remi-php70 php 来确认一下php的版本。

这个安装方式的具体原理请看下面的一些参考文章:

http://www.servermom.org/how-to-enable-remi-repo-on-centos-7-6-and-5/2790/

http://www.servermom.org/install-and-enable-epel-repo-on-centos-7/2780/

http://blog.remirepo.net/post/2016/04/16/My-PHP-Workstation

http://www.zabbix.cc/technic/1420/

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template