PHPackages                             mouf/whoops-stackphp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. mouf/whoops-stackphp

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

mouf/whoops-stackphp
====================

This package provides a StackPHP middleware for using the Whoops error handling library

v1.0.0(11y ago)145.7k3[1 issues](https://github.com/thecodingmachine/whoops-stackphp/issues)1MITPHPPHP &gt;=5.3.0

Since Dec 17Pushed 10y ago16 watchersCompare

[ Source](https://github.com/thecodingmachine/whoops-stackphp)[ Packagist](https://packagist.org/packages/mouf/whoops-stackphp)[ Docs](https://github.com/thecodingmachine/whoops-library)[ RSS](/packages/mouf-whoops-stackphp/feed)WikiDiscussions 2.0 Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (1)

Whoops middleware for StackPHP
==============================

[](#whoops-middleware-for-stackphp)

This package contains a [StackPHP middleware](http://stackphp.com/) that catches all exceptions and redirects those to the [Whoops error handling library](http://filp.github.io/whoops/).

Installation
------------

[](#installation)

Through [Composer](https://getcomposer.org/) as [mouf/whoops-stackphp](https://packagist.org/packages/mouf/whoops-stackphp).

Usage
-----

[](#usage)

Simply use the `WhoopsMiddleWare` class in your middleware stack:

```
use Whoops\StackPhp\WhoopsMiddleWare;

$router = new WhoopsMiddleWare(
	new MyOtherRouter(
		new YetAnotherRouter()));
```

If an exception is thrown, or an error is raised, Whoops will display a nice error message:

[![Sample error screen](https://camo.githubusercontent.com/ffb8848847171bc5a14cb19a8059a247b8e1a251f8f3a48acb2d173966cd35cb/687474703a2f2f66696c702e6769746875622e696f2f77686f6f70732f73637265656e2e706e67)](http://filp.github.io/whoops/demo/)

The `WhoopsMiddleWare` constructor accepts 3 parameters:

```
public function __construct(HttpKernelInterface $router, $catchExceptions = true, $catchErrors = true);
```

- **$router**: this is the next router to be called on the Stack
- **$catchExceptions**: Set to true to catch exception. Set to false to ignore exceptions (for production servers)
- **$catchErrors**: Set to true to catch raised errors. Set to false to ignore raised errors (for production servers)

Note: `$catchExceptions` and `$catchErrors` can be passed a boolean, a callable (that returns a boolean) or a [ConditionInterface](http://mouf-php.com/packages/mouf/utils.common.conditioninterface/README.md) that evaluates to true or false.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~245 days

Total

3

Last Release

3680d ago

Major Versions

v1.0.0 → 2.0.x-dev2016-04-20

PHP version history (2 changes)1.0.x-devPHP &gt;=5.3.0

2.0.x-devPHP &gt;=5.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104771?v=4)[mouf](/maintainers/mouf)[@Mouf](https://github.com/Mouf)

---

Top Contributors

[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (3 commits)")[![nguyenk](https://avatars.githubusercontent.com/u/2227554?v=4)](https://github.com/nguyenk "nguyenk (2 commits)")[![cbalda](https://avatars.githubusercontent.com/u/6704490?v=4)](https://github.com/cbalda "cbalda (1 commits)")

---

Tags

whoopsmoufStackPHP

### Embed Badge

![Health badge](/badges/mouf-whoops-stackphp/health.svg)

```
[![Health](https://phpackages.com/badges/mouf-whoops-stackphp/health.svg)](https://phpackages.com/packages/mouf-whoops-stackphp)
```

###  Alternatives

[filp/whoops

php error handling for cool kids

13.2k402.4M1.4k](/packages/filp-whoops)[yireo/magento2-whoops

Magento 2 module adding Whoops error handling

102703.5k](/packages/yireo-magento2-whoops)[rarst/wps

WordPress plugin for whoops error handler.

129133.2k3](/packages/rarst-wps)[gourmet/whoops

Whoops for CakePHP 3

2438.0k1](/packages/gourmet-whoops)[dereuromark/cakephp-whoops

Whoops error handler for CakePHP

1492.4k1](/packages/dereuromark-cakephp-whoops)[xiaodi/think-whoops

A debug service for ThinkPHP.

413.5k1](/packages/xiaodi-think-whoops)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
