yum方式安装lnmp

1、安装mysql
>>>yum -y install mariadb mariadb-server
给root用户设置密码
>>>mysqladmin -uroot password "pwd123"
>>>grant all privileges on *.* to 'root'@'localhost' identified by 'pwd123' with grant option;#高版本可能出现问题
>>>grant all privileges on *.* to "root"@"localhost" identified by "pwd123";


2、安装php
>>>yum -y install php php-fpm php-mysql php-gd
centos7.2不需要设置php.ini和php-fpm.conf

3、安装nginx
>>>yum -y install nginx
或者源码安装
>>>yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
>>>./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module


4、配置
nginx
location ~ .php$ {
  root html/aaaa;
  fastcgi_pass 127.0.0.1:9000;
  fastcgi_index index.php;
  include fastcgi.conf;
}

原文地址:https://www.cnblogs.com/linyouyi/p/9821556.html