Ubuntu16.04 LNMP (PHP7.0+Mysql5.7+Nginx1.10)
来源:互联网 发布:淘宝app的开发 编辑:程序博客网 时间:2024/05/01 06:18
1. system update:
apt-get update
apt-get upgrade
2.install softwares:
sudo apt-get install nginx php7.0-fpm mysql-server-5.6 php7.0-mysql
3.configer:
然后改配置文件,php的配置文件不用改就能用,nginx的配置文件不行,默认情况下是不支持php CGI的,所以得改一下:
vim /etc/nginx/sites-available/default
找到
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
#}
改成
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
大概意思就是所有以 .php 积极结尾的文件都传给php7.0-fpm去处理,处理完了把结果发给nginx,然后再由nginx发给客户机
然后重启一下服务:
systemctl restart nginx
systemctl restart php7.0-fpm
systemctl restart mysql
就好啦默认的网站根目录在/var/www/html/(可以通过nginx的配置文件里root 的那行改)
题主要是想搭wordpress之类的话,要把index.php当做主页的
就是把nginx配置文件中的
index index.html index.htm index.nginx-debian.html;
改成 index.php
0 0
- Ubuntu16.04 LNMP (PHP7.0+Mysql5.7+Nginx1.10)
- 最新lnmp安装(nginx1.10,php7 ,mysql5.5)
- CentOS 7 安装 LNMP 环境(PHP7 + MySQL5.7 + Nginx1.10)
- centos7.3 下 安装lnmp(nginx1.10、mysql5.7、php7.0.20)
- LEMP(LNMP)环境搭建(ubuntu16.04(ubuntu14.04)+nginx+mysql5.7+php7.1)
- CentOS6.5+Nginx1.9+Mysql5.7+PHP7.0.6(LNMP)环境配置
- Centos7.0编译安装lnmp环境(nginx1.9.9+php7.1.6+mysql5.7.17)
- LNMP环境搭建,自启动 php7,mysql5.6,nginx1.11
- LNMP环境搭建 mysql5.7.20+nginx1.13.7+php7.1.12
- lnmp搭建(Nginx1.12.1;mysql5.7.20;php7.2.0)
- Ubuntu 14.04 安装配置MySQL5.7 PHP7.1 Nginx1.10
- Ubuntu16.04 php7.0+mysql5.7+apache2环境搭配
- ubuntu16.04搭建lamp环境(Apache2+PHP7.0+MySQL5.7)
- Ubuntu16.04 php7.0+mysql5.7+apache2环境搭配
- LNMP, CentOS7.0+Nginx+Mysql5.7+PHP7环境安装
- LNMP源码编译安装(centos7+nginx1.9+mysql5.6+php7)
- 【最新版lnmp编译安装】编译安装nginx1.10.2最新版、php7.0.12最新版、mysql5.7.16最新版
- 【最新版lnmp编译安装】编译安装nginx1.10.2最新版、php7.0.12最新版、mysql5.7.16最新版
- scala基础---集合操作汇总
- windows平台调用函数堆栈的追踪方法
- 架构探险-从零开始写Javaweb框架读书笔记(5)
- 面试经典题--概论
- LightOJ 1104
- Ubuntu16.04 LNMP (PHP7.0+Mysql5.7+Nginx1.10)
- [又值奥运季] 2016年里约奥运会--8月21日赛事
- LeetCode | Letter Combinations of a Phone Number
- scala基础-----iterators类操作
- python 字符串前加'r'的作用
- make smdk2410_config流程分析
- 乐乐一下
- 文章标题
- Get Start With HTML