yum安装php7和相关扩展

【radhat yum 源】

成都创新互联公司-成都网站建设公司,专注网站设计制作、网站设计、网站营销推广,国际域名空间,雅安服务器托管网站托管有关企业网站制作方案、改版、费用等问题,请联系成都创新互联公司

rpm -aq|grep yum|xargs rpm -e --nodeps 

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm 

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm

安装下载的应用

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm

rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

rpm -Uvh python-urlgrabber-3.9.1-11.el6.noarch.rpm

rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm

新建/etc/yum.repos.d/centos.repo

[base]

name=CentOS-$releasever - Base

baseurl=http://mirrors.163.com/centos/6/os/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

#released updates

[updates]

name=CentOS-$releasever - Updates

baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

[extras]

name=CentOS-$releasever - Extras

baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/

gpgcheck=1

enabled=0

【centos  yum 源】

安装php7和相关扩展

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm    

rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm   (nginx)

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

备注:如果发现上面三行有的执行不成功;可以先通过wget获取包,然后在rpm;

例如:rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm    

(1) wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm    

(2) rpm -Uvh  epel-release-6-8.noarch.rpm   

1.cd /etc/yum.repos.d

2.nano remi.repo 

>>>>

[remi-php55]

name=Remi's PHP 5.5 RPM repository for Enterprise Linux 6 - $basearch

#baseurl=http://rpms.remirepo.net/enterprise/6/php55/$basearch/

mirrorlist=http://rpms.remirepo.net/enterprise/6/php55/mirror

# NOTICE: common dependencies are in "remi-safe"

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

>>>>>

将enabled设置为0;

3.nano remi.repo 

   >>>

[remi-php70]

name=Remi's PHP 7.0 RPM repository for Enterprise Linux 6 - $basearch

#baseurl=http://rpms.remirepo.net/enterprise/6/php70/$basearch/

mirrorlist=http://rpms.remirepo.net/enterprise/6/php70/mirror

enabled=0

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

>>>>>

将enabled设置为1;

4.安装扩展:

yum install php-solr php-opcache php-seasLog php-MySQLnd php-hprose php-mbstring php-mcrypt php-MongoDB php-mysqli php-gd php-dom php-apc php-memcache php-redis

service php-fpm restart && service nginx restart

卸载多余的应用:

yum groupremove "KDE 桌面" "通用桌面"  "Java 平台"  "互联网浏览器"  "办公套件和生产率" "Java 平台" "互联网应用程序" "图形生成工具" "图形管理工具" "打印客户端"  "桌面调试和运行工具"  "目录客户端" "电子邮件服务器" "MySQL 数据库客户端" "MySQL 数据库服务器”


当前标题:yum安装php7和相关扩展
分享地址:http://csdahua.cn/article/jooeho.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流