您的位置:首页 > 运维架构 > Nginx

nginx+php简单配置环境

2013-12-27 18:13 295 查看
首先我的需求是:

1. 需要有PHP的服务。web目录存放在各处。

2. 需要有多个端口。

步骤:

1. 安装nginx php,我的系统是mac 所以安装使用brew, 一键完成。。。

2. 开启php-fastcgi.

nohup php-cgi -b 3344&


  简单要说明,nohup 表示后端启动 ,商品为3344

3. 配置nginx

location ~ \.php$ {
root           /Users/yansunrong/demo;
fastcgi_pass   127.0.0.1:3344;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
include        fastcgi_params;
}


重启nginx

sudo nginx -s reload
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: