安裝epel源
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
centos7
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install nginx mariadb-server php php-devel -y
centos6
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
下載
yum install nginx mysql mysql-srever php php-devel -y
修改配置文件
nginx配置文件路徑
/etc/nginx/nginx.conf
修改nginx使其支持php
配置詳情看 linux-lnmp-編譯安裝 https://mp.csdn.net/postedit/80826246https://mp.csdn.net/postedit/80826246
php配置文件路徑
vim /etc/php.ini
cgi.fix_pathinfo=0
啓動nginx php mysql