码迷,mamicode.com
首页 > 移动开发 > 详细

使用nginx部署Yii 2.0\yii-basic-app-2.0.5

时间:2015-08-06 12:42:14      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:

nginx.conf

#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

#log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘
# ‘$status $body_bytes_sent "$http_referer" ‘
# ‘"$http_user_agent" "$http_x_forwarded_for"‘;

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

#root E:/xampp/htdocs/html5/php/yii2-rest-master/rest/web;
root E:/xampp/htdocs/html5/php/yii-basic-app-2.0.5/basic/web;
index index.php;

location / {
try_files $uri $uri/ /index.php?$args;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}

}

说明:启动php、nginx之后,使用浏览器访问http://localhost/即可

参考:安装 Yii - Yii 2.0 权威指南 - 文档 - Yii Framework 中文社区

   PHP For Windows/php-5.6.11-Win32-VC11-x64启动脚本

使用nginx部署Yii 2.0\yii-basic-app-2.0.5

标签:

原文地址:http://www.cnblogs.com/jackiehe/p/4707368.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!