Centos7下LNMP环境搭建

安装环境

  • Centos 7.2
  • PHP 7.2.5
  • Nginx 1.12..2
  • MySQL

更新yum

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm   
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

1、安装php

sudo yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml

2、安装nginx

sudo yum -y install nginx

3、安装MySQL

  • 进入Mysql 官网寻找yum源(https://dev.mysql.com/downloads/repo/yum/),选择DOWNLOADS下的Yum Repository,翻到下面选择一个yum源文件进行下载
    image.png

    进入下载页面
    image.png

    得到下载地址:https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
sudo rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
sudo vim /etc/yum.repos.d/mysql-community.repo #选择要安装MySQL的版本号

选择安装版本号

需要哪个版本就设置对应版本下的enabled=1,然后复制上面的内容,确保只有一个enabled=1
安装

yum -y install mysql-community-serverysql

你可能感兴趣的:(Centos7下LNMP环境搭建)