下载框架
到官网http://kohanaframework.org/下载,我用的是3.2。。。3.3的框架要求要php5.3以上
配置(php5.2+kohana3.2+nginx)
一,解压kohana压缩包,重命名为kohanademo(这个是项目名,可以改其他的名字)
二、配置好nginx如下
server
{
listen 80;
server_name kohanademo.my.com ;
#server_name localhost;
index index.html index.htm index.php;
root /mnt/hgfs/code/kohanademo;
location ~ ^(.*)svn\/ {
deny all;
}
location ~ \swp$ {
deny all;
}
location ~ .*\.php$
{
include fcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
expires off;
}
access_log /data/logs/kohanademo.my.com.log access;
}
reload一下nginx以后,浏览器输入http://kohanademo.my.com/看到如下界面
说明可以运行。
三、把kohana/install.php改名为install.php.back或者直接删除掉,接下来在kohana/application/bootstrap.php找到
Kohana::init(array(
'base_url' => '/',
));
修改为
Kohana::init(array(
'base_url' => '/kohanademo/',
));
到此配置结束