Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PHP
  3. PSR-15 Middlewares

PSR-15 Middlewares

MIT

A comprehensive collection of reusable PSR-15 middleware components for PHP applications.

GitHubGitHub
411 stars14 forks0 contributors

What is PSR-15 Middlewares?

PSR-15 Middlewares is a collection of reusable middleware components for PHP applications that comply with the PSR-15 standard. It provides modular solutions for handling common HTTP tasks such as authentication, security, logging, optimization, and routing. The project simplifies building and maintaining PHP web applications by offering standardized, interoperable middleware.

Target Audience

PHP developers building web applications or APIs who need standardized middleware for request/response processing, especially those using PSR-7 and PSR-15 compatible frameworks or dispatchers.

Value Proposition

Developers choose PSR-15 Middlewares for its comprehensive, standards-compliant collection that eliminates the need to write boilerplate middleware code. Its modular design allows easy integration and customization, promoting code reuse and maintainability across projects.

Overview

Collection of PSR-15 middlewares officially developed by Middlewares organization

Use Cases

Best For

  • Adding authentication (Basic/Digest) to PHP APIs
  • Implementing security features like CORS, CSP, and firewalls
  • Optimizing web performance with caching and response compression
  • Logging and debugging HTTP requests in development
  • Handling URL normalization and redirects
  • Processing request payloads (JSON, URL-encoded, CSV)

Not Ideal For

  • Projects using frameworks like Laravel or Symfony with their own integrated middleware systems, as PSR-15 compatibility might require extra configuration
  • Applications needing modern authentication such as OAuth 2.0 or JWT, since it only supports Basic and Digest authentication methods
  • Teams preferring a single, unified documentation source, as issues and contributions are handled per-component across multiple repositories

Pros & Cons

Pros

Modular and Standards-Based

Adheres to PSR-15, ensuring interoperability with any compatible dispatcher, as demonstrated in the usage example with Dispatcher chaining multiple middlewares.

Comprehensive Feature Set

Offers middlewares for authentication, security, optimization, and more, covering common HTTP tasks like CORS, compression, and logging without custom code.

Easy Integration and Chaining

The README example shows straightforward setup with a dispatcher array, allowing developers to mix and match middlewares like ErrorHandler and GzipEncoder.

Active Component Maintenance

Each middleware has its own GitHub repository for focused updates, as noted in the contributing section, ensuring targeted bug fixes and enhancements.

Cons

Fragmented Documentation

Contributing guidelines direct users to individual component repositories for issues, making consolidated learning and troubleshooting more difficult.

Setup Complexity

Requires separate PSR-7 and PSR-15 implementations, adding initial configuration overhead compared to framework-native middleware solutions.

Limited Authentication Options

Only includes Basic and Digest authentication; developers must seek external libraries for OAuth, JWT, or other modern standards.

Frequently Asked Questions

Quick Stats

Stars411
Forks14
Contributors0
Open Issues0
Last commit1 year ago
CreatedSince 2016

Tags

#php-middleware#http-middleware#authentication#http#performance-optimization#api-development#psr-15#php-framework#web-development#security-middleware#middleware#routing

Built With

P
PHP

Included in

PHP32.5k
Auto-fetched 1 day ago

Related Projects

Laminas StratigilityLaminas Stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

Stars57
Forks12
Last commit2 days ago
StackStack

A library of stackable middleware for Symfony

Stars0
Forks0
Last commit
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub