2011-04-08 61 views
0

我一直试图在我自己的WAMP服务器上安装Kohana,但一直处于死路一条。我一直按照说明here直到.htaccess文件修改; 我重定向的指定,但然后得到一个'内部服务器错误',说明这是一个配置错误。我尝试了一堆组合,但仍然遇到同样的错误。Kohana 3.0安装问题 - 新的控制器问题

我发现的唯一工作方法不包括.htaccess文件,只是正确地将bootstrap.php指向正确的路径。 这使我的welcome.php控制器的例子,但是,然后,我尝试创建一个新的控制器,如上所述,并输入特定的路径(mysite/controller_name),但我得到404错误。

任何想法我错了吗?

bootstrap.php中 -

Kohana::init(array(
'base_url'  => '/shiftrunner/kohana-shiftrunner/', 
'index_file' => '' 
)); 

的.htaccess - #URL重写RewriteEngine叙述 打开

# Installation directory 
RewriteBase /shiftrunner/kohana-shiftrunner Protect hidden files from being viewed 
<Files .*> 
Order Deny,Allow 
Deny From All 
</Files> 

# Protect application and system files from being viewed 
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L] 

# Allow any files or directories that exist to be displayed directly 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

# Rewrite all other URLs to index.php/URL 
RewriteRule .* index.php/$0 [PT] 
+0

请注意更换

RewriteRule .* index.php/$0 [PT] 

,我这个位于中安装一个子目录例如root/some_project/kohana – lionysis 2011-04-08 11:30:28

+0

Kohana是在子文件夹还是在根目录下运行?我们可以看到你的.htaccess吗?我们可以看到有关'base_url'(你给Kohana :: init的数组)的bootstrap.php部分吗? – Donovan 2011-04-08 11:31:35

+0

bootstrap.php中 - 'code'Kohana ::的init(阵列( \t 'BASE_URL' \t => '/ shiftrunner/Kohana的-shiftrunner /', \t 'index_file' \t => '' ));'代码' – lionysis 2011-04-08 12:27:28

回答

0

你RewriteBase应/shiftrunner/kohana-shiftrunner/与下列斜线,完全一样base_url在你的引导。

index_file应该设置为false如果您不希望它显示,而不是''

如果上述不使它工作,我也想尝试与

RewriteRule .* index.php [L]