您好,我的kohana代码有问题,它给我带来了同样的错误,我认为是htaccess或bootstrap有问题
它安装在我的根目录下,而不是作为一个子文件夹。
Kohana_HTTP_Exception [ 404 ]: The requested URL / was not found on this server.
SYSPATH/classes/Kohana/Request/Client/Internal.php [ 79 ]
74 if ( ! class_exists($prefix.$controller))
75 {
76 throw HTTP_Exception::factory(404,
77 'The requested URL :uri was not found on this server.',
78 array(':uri' => $request->uri())
79 )->request($request);
80 }
81
82 // Load the controller using reflection
83 $class = new ReflectionClass($prefix.$controller);
84
SYSPATH/classes/Kohana/Request/Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request(arguments)
SYSPATH/classes/Kohana/Request.php [ 990 ] » Kohana_Request_Client->execute(arguments)
DOCROOT/index.php [ 109 ] » Kohana_Request->execute() 这是我的htaccess代码
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# 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]
#-SetEnv KOHANA_ENV "production"在引导程序中,我将site_url设置为'/‘
发布于 2013-03-12 05:12:34
当我将kohana从本地主机迁移到linux主机时,我也遇到了同样的问题。
尝试用大写字母重命名您的控制器文件。在bootstrap路由中,保留小写字母。
这对我有帮助。
发布于 2012-12-13 02:33:45
请尝试并尽可能多地发布bootstrap.php文件。很可能您没有默认的根集。
在文件中搜索代码块,如下所示
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'default',
'action' => 'index',
));关键字是Route::set('default', '(<controller>(/<action>(/<id>)))')
您的应用程序托管在哪里?它是在www上还是在www的子文件夹中?
发布于 2013-07-06 02:41:53
您看到的是当您没有使用set up your environment to run for the first time to use clean urls时抛出的错误。执行以下操作:
.htaccess文件,并为RewriteBase设置正确的路径(如果您的本地主机路径为localhost/my/site,则您的htaccess应为:RewriteBase /localhost/my/site/
(确保将文件重命名为.htaccess )
Kohana::init具有:在其array.
'base_url' => '/localhost/my/site/' /application/classes/Controller/目录中,添加控制器文件名以使第一个字母为大写(即Welcome.php),并在控制器内部确保控制器内容写入正确。/application/classes/Controller/Welcome.php
这是解决问题的良好开端。
https://stackoverflow.com/questions/13760897
复制相似问题