Kohana的3.0安装问题 - 新控制器的问题 [英] Kohana 3.0 installation problems - New controller issues

查看:174
本文介绍了Kohana的3.0安装问题 - 新控制器的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在想我自己的WAMP的服务器上安装Kohana的,但已运行到有点穷途末路。我跟着指示的这里直到.htaccess文件的修改; 我重定向的规定,但是又出现了一个内部断绝错误,指出它是一个配置错误。我已经试过了一堆的组合,我仍然得到同样的错误。

我发现不包括.htaccess文件并简单地指向正确的bootstrap.php中正确的道路是唯一的工作方法。 这使得我的welcome.php控制器的例子,但是,我再试试,并创建一个新的控制器中提到,进入特定的路径(mysite的/ CONTROLLER_NAME),但我得到的404错误。

任何我要去哪里错了的想法?

bootstrap.php中 -

 的Kohana ::初始化(阵列(
BASE_URL'=> / shiftrunner / Kohana的-shiftrunner /',
index_file'=> ''
));
 

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

 #安装目录
的RewriteBase / shiftrunner / Kohana的-shiftrunner被视为保护隐藏文件
<文件*>
订单拒绝,允许
禁止从所有
< /文件>

#被查看保护应用程序和系统文件
重写规则^(?:应用|模块|系统)。\ B *的index.php / $ 0 L]

#允许存在直接显示的任何文件或目录
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d

#重写所有其他URL的index.php / URL
重写规则。*的index.php / $ 0 PT]
 

解决方案

您的RewriteBase应 / shiftrunner / Kohana的-shiftrunner / 与下面的斜杠,完全一样 BASE_URL 在你的引导。

index_file 应设置为如果你不希望它显示出来,而不是

如果上述方法不使它工作,我还尝试更换

 重写规则。*的index.php / $ 0 PT]
 

 重写规则。*的index.php [L]
 

I've been trying to install Kohana on my own WAMP server but have been running into a bit of a dead end. I've followed the instructions here up until the .htaccess file modification; I redirect as specified but then get an 'internal sever error' stating that it is a configuration error. I've tried a bunch of combinations and I still get the same error.

The only working method I've found is not including the .htaccess file and simply correctly pointing the bootstrap.php to the right path. This renders my welcome.php controller example, however, I then try and create a new controller as mentioned and enter the specific path (mysite/controller_name) but I get 404 Error.

Any ideas where I'm going wrong?

bootstrap.php -

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

.htaccess - # Turn on URL rewriting RewriteEngine On

# 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]

解决方案

Your RewriteBase should be /shiftrunner/kohana-shiftrunner/ with the following slash, exactly the same as base_url in your bootstrap.

index_file should be set to false if you don't want it displayed, not ''.

If the above doesn't make it work, I'd also try replacing

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

with

RewriteRule .* index.php [L]

这篇关于Kohana的3.0安装问题 - 新控制器的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆