用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3354|回复: 4
收起左侧

准备学习ci,但是第一个blog就因为不知道如何配置而搁浅

[复制链接]
发表于 2010-5-7 22:28:34 | 显示全部楼层 |阅读模式
nginx下需要什么特别的配置才能使用CI吗?
根本就无法运行,指南中的 blog hello world
发表于 2010-5-7 23:18:44 | 显示全部楼层
手册都是以 apache 为主要服务器的,nginx 当然不行了,不过你为什么要用 nginx 呢?
 楼主| 发表于 2010-5-8 12:24:57 | 显示全部楼层
回复 2# Hex


   
速度快,系统消耗低

而且 我即使用了 apache 也是一样不行的,虽然不是nginx的404 not found  但是也是object not found

Apache  我用的是 张宴的 APMServ v5.2.6 非常好用,只有CI上去搁浅了
发表于 2010-5-8 12:44:26 | 显示全部楼层
我觉得你首先应该学会的一项编程技术和思路,比如CI下的blog。然后再试图将其部署到ngix。

一个麻烦问题,不管大小,都应该分解成多个步骤。

Ref:http://route19.com/logbook/view/codeigniter-urls-nginx

出现object not found,应该还是PATH_INFO的问题。请google。
 楼主| 发表于 2010-5-8 14:30:38 | 显示全部楼层
本帖最后由 jasonshaw 于 2010-5-8 14:32 编辑

回复 4# saturn


    不知道是NPMserv0.5.0的问题还是其他的,按照上面提供的链接没成功。

不过却安装hex提供的页面,修改为:
PHP复制代码
server {
    listen       80;
    server_name  localhost;
    location / {
        root   D:/programming/NPMserv/www;
        index  index.html index.htm index.php default.php;
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
    location ~ .*\.php {
        root           D:/programming/NPMserv/www;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        set $path_info "";
        set $real_script_name $fastcgi_script_name;
            if ($fastcgi_script_name ~ "^(.+?.php)(/.+)$") {
                 #set $real_script_name $1;
                set $path_info $2;
            }
        fastcgi_param PATH_INFO $path_info;
        fastcgi_param  SCRIPT_FILENAME  D:/programming/NPMserv/www$fastcgi_script_name;
        include        fastcgi_params;
    }
}
 
复制代码


现在可以打开blog 页面 但是不是指南中给出的地址 用http://localhost/ci/index.php/blog  是可以的,但是http://localhost/ci/index.php/blog/ 是404 not found

不知道是不是会造成影响,如果会的话,那应该怎么操作?

本版积分规则