更改

跳转至: 导航搜索

在CentOS7下安装PHP7

添加1,222字节, 2018年11月24日 (六) 18:50
无编辑摘要
[[File:CentOS7PHP74.png]]
5.输入“rpm -Uvh <nowiki> https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm </nowiki>”尝试从官网更新EPEL。
注意:EPEL(Extra Packages for Enterprise Linux,企业版Linux的额外软件包)是一个由特别兴趣小组创建、维护并管理的,针对 红帽企业版 Linux(RHEL)及其衍生发 行版(比如 CentOS、Scientific Linux、Oracle Enterprise Linux)的一个高质量附加软件包项目。可点击[https://fedoraproject.org/wiki/EPEL/zh-cn 官网]了解详情。
[[File:CentOS7PHP75.png]]
6.如出现如下错误则表明从官网更新EPEL失败。
error: skipping <nowiki> https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm </nowiki> - transfer failed
[[File:CentOS7PHP76.png]]
7. 如无法从官网更新则 可从以下 [https://admin.fedoraproject.org/mirrormanager/mirrors 官方网站]自行查找 国内镜像。[https 官网地址:https://admin.fedoraproject.org/mirrormangaermirrormanager/mirrors[[File:CentOS7PHP77.png]] 8.本例中使用中国科技大学的镜像,输入“rpm -Uvh <nowiki>https://mirrors .ustc.edu.cn/centos/7/extras/x86_64/Packages/epel-release-7-6.noarch.rpm</nowiki>”。[[File:CentOS7PHP78.png]] 9.提示已经更新成功。[[File:CentOS7PHP79.png]] 官方网站10.输入“rpm -Uvh <nowiki>https://centos7.iuscommunity.org/ius-release.rpm</nowiki>”并按回车键开始更新PHP的源。[[File:CentOS7PHP710.png]] 11.输入“yum search php7”查找PHP7,可发现均以php70u开头。[[File:CentOS7PHP711.png]] 12.输入“yum install php70u”开始安装PHP7。[[File:CentOS7PHP712.png]] 13.输入“y”开始下载。[[File:CentOS7PHP713.png]] 14.确认指纹无误后输入“y”即可开始安装。[[File:CentOS7PHP714.png]] 15.输入“php -v”尝试查找PHP版本,提示“-bash: php: command not found”错误。[[File:CentOS7PHP715.png]] 16.输入“yum install php70u-cli”安装php-cli环境。[[File:CentOS7PHP716.png]] 17.输入“y”确认开始安装。[[File:CentOS7PHP717.png]] 18.再次输入“php -v”即可查看PHP版本。[[File:CentOS7PHP77CentOS7PHP718.png]]
匿名用户

导航菜单