我在學習kohana,而我正在使用ver:3.3.0。Kohana:Kohana_HTTP_Exception [404]:在此服務器上找不到請求的URL日曆
我得到這個錯誤:
Kohana_HTTP_Exception [ 404 ]: The requested URL calendar was not found on this server.
SYSPATH\classes\Kohana\Request\Client\Internal.php [ 79 ]
SYSPATH\classes\Kohana\Request\Client\Internal.php [ 79 ]
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 [ 118 ] » Kohana_Request->execute()
URL我輸入:
(//localhost/organizer_tst/calendar/)
我的文件:
應用程序\類\控制器\日曆\ Calendar.php:
class Controller_Calendar extends Controller
{
public function action_index()
{
$tst = new Model_Calendar();
echo $tst->testing("LOLLOLOOLL");
}
}
ap摺疊\類\型號\ calendar.php:
Class Model_Calendar extends Model
{
public function testing($param)
{
$tst ="I want to display it: "."$param";
return $tst ;
}
}
bootstrap.php中:
Kohana::init(array(
'base_url' => '/organizer_tst/',
));
Route::set('something', 'calendar(/<directory>(/<controller>(/<action>(/<id>))))')
->defaults(array(
'directory' => 'Calendars',
'controller' => 'Calendar',
'action' => 'index',
));
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'welcome',
'action' => 'index',
));
我查了 「環境 - >包含文件」 的錯誤頁面上,我可以看到我的控制器文件: APPPATH \類\控制器\日曆\ Calendar.php
一切工作,如果控制器不是在這種情況下,一個額外的目錄: 應用程序\ CLASSES \控制器\日曆\ Calendar.php
我用XAMPP我的根目錄:d:\ XAMPP \ htdocs中 ,我有別名到我的項目: 別名/ organizer_tst /日曆 「d:\ XAMPP \ htdocs中\ organizer_tst」
能否請你告訴我,爲什麼我有這個錯誤異常?
你可以包含你的'.htaccess'文件嗎?此外,基地網址應該是一個完整的網址,例如:'http:// localhost/organizer_tst /'(可能與問題無關) – AmazingDreams