centos 通过yum 安装php7

背景

公司一直使用ubuntu,最近新接的任务,将web程序迁移到centos服务器下。研究了一下在centos下搭建lnmp,记录下其中过程。

安装过程

  • 安装前先确认centos/RHEL版本
uname -a
cat  /etc/redhat-release
  • 将与CentOS / RHEL版本对应的Webtatic EL yum存储库信息添加到yum
CentOS / RHEL 7.x:
yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS / RHEL 6.x:
yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
  • 现在可以安装php7.0及相关扩展
yum install php70w php70w-fpm
yum install php70w-gd php70w-mbstring php70w-mysql php70-redis php70w-curl php70w-zip php70w-dom

-查看php和php-fpm版本

image.png
  • 安装成功

你可能感兴趣的:(centos 通过yum 安装php7)