先安装:

sudo apt-get install nginx php5-fpm -y

然后编辑配置文件:

/etc/nginx/site-available/default

找到“location ~ \.php$”的地方,5行取消注释,变成这样:

location ~ \.php$ {

#fastcgi_split_path_info ^(.+\.php)(/.+)$;

## NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

#

## With php5-cgi alone:

#fastcgi_pass 127.0.0.1:9000;

## With php5-fpm:

fastcgi_pass unix:/var/run/php5-fpm.sock;

fastcgi_index index.php;

include fastcgi_params;

}

启动nginx:

sudo service nginx start

Ubuntu+Nginx+PHP的最简搭建方法的更多相关文章

  1. HHvm Apache 2.4 Nginx建站环境搭建方法安装运行WordPress博客

    HHvm Apache 2.4 Nginx建站环境搭建方法安装运行WordPress博客 VPS主机   2014年06月02日 17:20   评论»       文章目录 Debian上安装 Ce ...

  2. HHvm建站环境搭建方法:Nginx,Mariadb,hhvm及lnmp/lamp安装部署

    HHVM起源于Facebook公司,是一个开源的PHP虚拟机,使用JIT的编译方式以及其他技术,让PHP代码的执行性能大幅提升.HHVM提升PHP性能的途径,采用的方式就是替代Zend引擎来生成和执行 ...

  3. 利用docker搭建ubuntu+nginx+PHP容器

      环境:操作系统(Ubuntu  16.04 64位); php7.1;  nginx/1.14.0   基础环境准备: 整体思路:docker pull一个ubuntu镜像,然后在容器中安装ngi ...

  4. Ubuntu Nginx下配置网站ssl实现https访问

    最近在看  HTTP权威指南   看到介绍了HTTPS的ssl,自己就动手测试了下,将步骤记录下 HTTPS简介 什么是HTTPS?百科是这样解释的.HTTPS(全称:Hyper Text Trans ...

  5. Ubuntu Nginx安装

    1.先更新ubuntu系统 更新命令 sudo apt-get update sudo apt-get upgrade 2 添加ubuntu nginx更新源镜像 cd /etc/apt/ sudo ...

  6. nginx+uwsgi+django开发环境搭建

    Nginx+uWSGI+Djangoi开发环境搭建 Django简介,环境搭建 uWSGI简介,安装与配置 Nginx安装与配置 Nginx+uWSGI+Django原理解析 1.django简介,环 ...

  7. Nginx + FastCGI 程序(C/C++)搭建高性能web service的demo

    http://blog.csdn.net/chdhust/article/details/42645313 Nginx + FastCGI 程序(C/C++)搭建高性能web service的Demo ...

  8. Ubuntu Nginx uwsgi django 初试

    /************************************************************************************** * Ubuntu Ngi ...

  9. ubuntu+nginx+uwsgi部署django web项目

    前言 将本地开发的django项目部署至linux上的uwsgi服务器,并配置nginx,完成基于ubuntu+nginx+uwsgi的上线运行.下面整理相关步骤. 服务器配置virtualenv 如 ...

随机推荐

  1. iOS及时log日志查看工具 (iConsole)

    github下载地址:https://github.com/nicklockwood/iConsole 偶然看到的一个iOS及时log日志查看工具,通过该工具,我们可以在任何想看日志的时候,通过手势呼 ...

  2. Reactor模式详解

    转自:http://www.blogjava.net/DLevin/archive/2015/09/02/427045.html 前记 第一次听到Reactor模式是三年前的某个晚上,一个室友突然跑过 ...

  3. javascript字典数据结构常用功能实现

    必知必会啊. function Dictionary(){ var items = {}; this.has = function (key) { return key in items; }; th ...

  4. ytu 2463:给小鼠补充代码(DFS 深度优先搜索)

    2463: 给小鼠补充代码 Time Limit: 2 Sec  Memory Limit: 64 MBSubmit: 5  Solved: 2[Submit][Status][Web Board] ...

  5. Java Hour 61 基础概念拾遗

    循环遍历器 for (Iterator iter = list.iterator(); iter.hasNext();) { int i = ((Integer) iter.next()).intVa ...

  6. Android适配器之ArrayAdapter、SimpleAdapter和BaseAdapter的简单用法与有用代码片段(转)

    摘自:http://blog.csdn.net/shakespeare001/article/details/7926783 Adapter是连接后端数据和前端显示的适配器接口,是数据Data和UI( ...

  7. Codeforces Round #Pi (Div. 2) A. Lineland Mail 水

    A. Lineland MailTime Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/567/proble ...

  8. JavaScript案例七:简单生成表格

    JavaScript简单生成表格,巩固基础知识点... <!DOCTYPE html> <html> <head> <title>JavaScript简 ...

  9. eclipse中编译时enum出现cannot be resolved to a type错误

    eclipse中编译时enum出现cannot be resolved to a type错误 通常是因为eclise使用的jdk版本的问题...默认是使用的是jdk1.5 应该去选择成jdk1.6或 ...

  10. oracle创建临时表没有权限

    执行下面: grant create any table to 用户名称