A developer-friendly error page renderer inspired by Laravel Ignition, but standalone with no dependencies.
- Beautiful, modern error pages with dark/light theme
- Stack trace with code context
- Intelligent solution suggestions
- Request and environment information
- Responsive design
- Syntax-highlighted code blocks
composer require wepesi/hitilafu<?php
require_once 'vendor/autoload.php';
use Wepesi\Hitilafu\Hitilafu;
// Register the error handler
Hitilafu::register()
->setAppName('My Awesome App')
->setTheme('dark'); // or 'light'Add custom solutions for specific error patterns:
Hitilafu::register()
->addSolution(
'mysqli_connect',
'MySQL Connection Issue',
'Make sure your MySQL server is running and credentials are correct.',
[
['text' => 'MySQL Docs', 'url' => 'https://dev.mysql.com/doc/']
]
);custom solutions are used based on the application implementation like (plugins, component, models, controllers, ...)
Syntax errors (parse errors) occur during PHP's compilation phase, BEFORE your code executes. This means:
- Same file syntax errors: Cannot be caught because PHP parses the entire file before running it
- Included file syntax errors: CAN be caught via
handleShutdown()when usingincludeorrequire
This WON'T work (syntax error in main file):
<?php
Hitilafu::register(); // Handler registered
echo "test" // Syntax error - handler never runs because file fails to parseThis WILL work (syntax error in included file):
<?php
// index.php
Hitilafu::register(); // Handler registered successfully
include 'bad_file.php'; // If bad_file.php has syntax errors, handler catches itTo test syntax error you can check the example file where the is a list of custom example already tested.
<?php
Hitilafu::register();
// This will trigger the error handler
include 'example.php'; // Contains syntax errors- Runtime Errors: Division by zero, undefined variables, etc.
- Exceptions: Uncaught exceptions
- Fatal Errors: Memory exhaustion, maximum execution time
- Parse Errors: In included files (NOT in the main file)
- Warnings & Notices: Converted to ErrorException
The handler provides intelligent solutions for common errors:
- File not found
- Database connection errors
- Undefined variables/functions
- Class not found
- Memory exhausted
- Permission denied
- And more...
Apache2.0 License

