我该怎么做?我已经尝试了半个小时,这真的很恼人。你会认为这应该是一个基本且易于设置的框架。我希望可能有一种简单的方法,因为我开始认为如果这样的基本事情如此难以设置,那么我根本不应该选择这个框架。
这在我的bootstrap.php文件中应该能解决问题。
但我仍然收到 <\p>
这在我的bootstrap.php文件中应该能解决问题。
if ( ! defined('SUPPRESS_REQUEST'))
{
/**
* Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
* If no source is specified, the URI will be automatically detected.
*/
$request = Request::instance();
try
{
// Attempt to execute the response
$request->execute();
}
catch (Exception $e)
{
if (Kohana::$environment === Kohana::DEVELOPMENT)
{
// Just re-throw the exception
throw $e;
}
echo "ok";
// Create a 404 response
$request->status = 404;
$view = View::factory('error404');
$request->response = $view->render();
}
echo $request->send_headers()->response;
}
但我仍然收到 <\p>
Fatal error: Uncaught Kohana_Request_Exception [ 0 ]: Unable to find a route to match the URI: test ~ SYSPATH\classes\kohana\request.php [ 674 ] thrown in C:\Xampp\htdocs\system\classes\kohana\request.php on line 674
我自定义的404页面没有被使用。
是的,Kohana::$environment
被设置为 Kohana::PRODUCTION;
甚至连 echo "ok";
的部分都没有执行。为什么异常没有被捕获?