0

I am following the tutorial at http://kohanaframework.org/3.3/guide/kohana/tutorials/error-pages for Kohana 3.3

The following code is at classes/http/exception/404.php

 <?php
    class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {
        public function get_response(){
            $view = View::factory('errors/404');
            $view->message = $this->getMessage();
     
            $response = Response::factory()
                ->status(404)
                ->body($view->render());
     
            return $response;
        }
    }

When trying to give an incorrect url like

localhost/myapp/xyz

The following error comes up

ErrorException [ Parse Error ]:
APPPATH\classes\http\exception\404.php [ 3 ]
1 <?php
2 class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {
3 
4 
5 
6 
7 
8 
{PHP internal call} » Kohana_Core::shutdown_handler()

In bootstrap.php the code for init is

Kohana::init(array(
    'base_url'   => '/myapp/',
    'errors' => TRUE,
    'index_file' => FALSE,
));

How can I fix this? Thanks.

sharmacal
  • 457
  • 1
  • 6
  • 25

2 Answers2

1

A couple of things to check:

  • Does the errors/404 view exist at APPPATH/views/errors/404.php?
  • Does the class filepath and name use StudlyCaps APPPATH\Classes\HTTP\Exception\404.php?
Danny Thompson
  • 1,526
  • 1
  • 11
  • 18
0

Rename directory with a capital letter classes/HTTP/Exception/404.php