PHPackages                             wp-php-toolkit/http-server - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. wp-php-toolkit/http-server

ActiveLibrary[HTTP &amp; Networking](/categories/http)

wp-php-toolkit/http-server
==========================

HttpServer component for WordPress.

v0.8.1(1mo ago)1113GPL-2.0-or-laterPHPPHP &gt;=7.2

Since May 30Pushed 1mo agoCompare

[ Source](https://github.com/wp-php-toolkit/http-server)[ Packagist](https://packagist.org/packages/wp-php-toolkit/http-server)[ Docs](https://wordpress.github.io/php-toolkit/reference/httpserver.html)[ RSS](/packages/wp-php-toolkit-http-server/feed)WikiDiscussions trunk Synced today

READMEChangelogDependencies (16)Versions (49)Used By (0)

   slug httpserver   title HttpServer   install wp-php-toolkit/http-server   see\_also    cli | CLI | Expose a local browser UI from a command-line tool.

 httpclient | HttpClient | Test client code against a small local fixture server.

    A minimal blocking TCP HTTP server in pure PHP. For CLI tools and tests, not for production traffic.

Why this exists
---------------

[](#why-this-exists)

Sometimes a PHP tool needs a tiny local HTTP surface: a test fixture server, a webhook receiver during development, a CLI tool with a browser UI, or a demo endpoint for another component. Pulling in a production web framework would obscure the example and add dependencies the toolkit avoids.

The HttpServer component is intentionally small: a blocking TCP server, incoming request objects, and response writers. It is useful for local tools and tests. It is not a replacement for nginx, Apache, php-fpm, RoadRunner, Swoole, or a production application server.

Hello world on port 8080
------------------------

[](#hello-world-on-port-8080)

**Run on your machine:** the Playground sandbox does not allow processes to bind listening TCP ports. Save this snippet locally and run `php hello-server.php`.

```
