Chinaunix首页 | 论坛 | 博客
  • 博客访问: 224822
  • 博文数量: 35
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 938
  • 用 户 组: 普通用户
  • 注册时间: 2013-09-12 14:52
文章分类

全部博文(35)

文章存档

2016年(4)

2015年(5)

2014年(16)

2013年(10)

我的朋友

分类: 系统运维

2013-09-26 16:40:52

nginx配置支持php
  

前提:
1.php安装            详见
2.pcre            使用yum安装
3.zlib             使用yum安装
4.openssl       使用yum安装

    安装nginx
下载地址   

tar zxf  .tar.gz
cd nginx-1.5.5
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx2 --add-module=../ngx_cache_purge-1.5 --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
make;make install

    修改nginx.conf文件
-------------------------------------------------------------------

server {
    listen 80;
    server_name d.free.cn;
    root  /data0/web/
    index  index.htm index.php indx.html;
    location ~ \.php$
    {
      fastcgi_pass   127.0.0.1:9000;
      fastcgi_index  index.php;
      include        fcgi.conf;
    }
    access_log  /data0/logs/d.free.cn.log  access;
}

-------------------------------------------------------------------

上边的红字就是需要修改的地方

    测试
在网站根目录下面创建一个php文件
------------------------------
phpinfo()
?>
------------------------------
在浏览器中输入

如果出现下面的就代表成功了
阅读(2129) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~