Repolode
filp

filp/whoops

An error handling framework for PHP that replaces default error output with a readable debug page and structured JSON/XML responses.

Stars
13,226
Forks
599
Open issues
7
Last commit
7 days ago

What is it?

Whoops is a stackable error handling framework for PHP. Its main output is a detailed error page for web projects that shows the exception, stack trace and the surrounding source code, which makes debugging faster during development.

Beyond the HTML page, Whoops includes handlers for plain text output in CLI applications, and for JSON and XML responses that suit AJAX requests and APIs. Handlers are stacked, so you can combine them, and closures or callables can be registered as handlers as well. Referenced files can be opened directly in an editor or IDE.

The library has no required dependencies and can be installed with Composer. Many frameworks, including Laravel and Mezzio, already bundle it, and community integrations exist for others such as Slim, CakePHP and Zend.

Key features

  • 01Stack-based error handler that chains multiple handlers together
  • 02Pretty HTML error page with stack trace and source context
  • 03JSON, XML, and plain text response handlers
  • 04Open referenced files directly in an editor or IDE
  • 05No required dependencies and installable via Composer

Use cases

  • Debugging PHP web applications during development
  • Returning structured error responses from AJAX or API endpoints
  • Showing readable error output in PHP command-line tools

Quick start

  1. 1

    Install Whoops into your PHP project with Composer

    composer require filp/whoops
  2. 2

    Register the pretty error handler in your code

Topics

FAQ

What is whoops?
An error handling framework for PHP that replaces default error output with a readable debug page and structured JSON/XML responses. Whoops is a stackable error handling framework for PHP. Its main output is a detailed error page for web projects that shows the exception, stack trace and the surrounding source code, which makes debugging faster during development.
Is whoops free to use? What license does it have?
whoops is open source under the MIT license. Check the license terms before using it in commercial products.
Is whoops still maintained?
Actively maintained. The last commit to whoops was on Oct 18, 2026.
What can I use whoops for?
Debugging PHP web applications during development Returning structured error responses from AJAX or API endpoints Showing readable error output in PHP command-line tools
How do I install whoops?
Install Whoops into your PHP project with Composer: composer require filp/whoops Register the pretty error handler in your code
Where can I get whoops?
The source code and installation instructions are on GitHub: https://github.com/filp/whoops

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects