centos php 开启mysql扩展_CentOS 7下部署php7.1和开启MySQL扩展的方法教程

前言

之前在CentOS7安装php7.1的时候有遇到PHP源及PHP7.1不支持MySQL扩展问题,上午抽空安装了下终于解决了这两个问题,特此记录备忘。

简单安装(yum方式)

安装软件源

添加epel源[root@opstrip.com opt]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*[root@opstrip.com opt]# rpm -Uvh http://mirrors.rit.edu/fedora/epel//7/x86_64/e/epel-release-7-9.noarch.rpm

添加remi源[root@opstrip.com opt]# rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

安装并更新软件

安装yum-config-manager实用程序[root@opstrip.com opt]# yum -y install yum-utils

更新系统当前软件版本[root@opstrip.com opt]# yum -y update

更新完成后,就可以安装所需要的PHP版本了。

安装PHP

以上准备工作完成后,就可以安装所需的PHP版本了。

对于PHP5.4[root@opstrip.com opt]# yum -y install php

安装前可尝试yum search php54搜索可安装的软件包。

对于PHP7.0[root@opstrip.com opt]# yum-config-manager --enable remi-php70[root@opstrip.com opt]# yum -y install php php-opcache

安装前可尝试yum search php70搜索可安装的软件包。

对于PHP7.1[root@opstrip.com opt]# yum-config-manager --enable remi-php71[root@opstrip.com opt]# yum -y install php php-opcache

安装前可尝试yum search php71搜索可安装的软件包。

完成后还需要添加PHP常用扩展:[root@opstrip.com opt]# yum -y install php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel

对于Nginx[root@opstrip.com opt]# yum -y install nginx nginx-mod-http-perl nginx-mod-stream nginx-filesystem nginx-mod-mail nginx-mod-http-i

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值