Basic improved kohana custom error pages for CLI and web use

0.1.1 2014-07-03 17:08 UTC


Just a really simple kohana module that sets custom error pages for web (outside development mode) and CLI (always).


Add kohana-errors to your composer.json and run composer update to install it.

  "require": { "ingenerator/kohana-errors": "0.1.*@dev" }

Basic Usage

In your bootstrap:

Kohana::modules(array('kohana-errors' => BASEDIR.'vendor/ingenerator/kohana-errors');

To further customise the error page, create a view file at APPATH.views/errors/web_generic_error.php or APPATH.views/errors/cli_generic_error.php

Bear in mind that the custom error page will only be applied after your application has loaded the module - so you still risk another error page showing if there are failures during very early bootstrapping of your application.

Best practice is to configure your apache/nginx to show a custom static error page on fatal errors, rather than trusting PHP to get it right...

Testing and developing

There are no specs for this module, as it's very basic. Contributions are welcome.


config is copyright 2014 inGenerator Ltd and released under the BSD license.