PHPackages                             tijmen-wierenga/async-php-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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. tijmen-wierenga/async-php-server

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

tijmen-wierenga/async-php-server
================================

Fast asynchronous PHP server

v0.1.0(8y ago)038MITPHP

Since Jul 30Pushed 8y ago2 watchersCompare

[ Source](https://github.com/TijmenWierenga/async-php-server)[ Packagist](https://packagist.org/packages/tijmen-wierenga/async-php-server)[ RSS](/packages/tijmen-wierenga-async-php-server/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (2)Used By (0)

Asynchronous PHP Server
=======================

[](#asynchronous-php-server)

This package contains an easy to use asynchronous PHP server which you can setup in minutes. Get rid of bootstrapping your entire application on every request!

The server is build with the awesome [React PHP](https://github.com/reactphp) components which enables you to speed up your application. Do all the necessary bootstrapping of your app only once, and keep it in memory as all requests are being handled in an asynchronous way.

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

[](#installation)

There are two ways to install the server:

### Manual

[](#manual)

Install the repository using GIT:

```
git clone https://github.com/TijmenWierenga/async-php-server.git
```

### Composer

[](#composer)

```
composer require tijmen-wierenga/async-php-server
```

Example
-------

[](#example)

The repository comes with an example server which you can run locally. To run the example server simply run it in php:

```
php example/demo-server.php
```

Or run it with Docker (make sure you mount the correct volume to the container):

```
docker run \
    --rm \
    -t \
    -d \
    -v ~/www/server:/var/www/html \
    --name async_php_server \
    php:7.1-fpm-alpine \
    php /var/www/html/example/demo-server.php
```

To check if the server is running, check the logs:

```
docker logs async_php_server
```

This should print: `Server is running on 0.0.0.0:9000`

To test the server, simply send a CURL command to the container:

```
docker exec async_php_server curl -H "Content-Type: application/json" -X POST -d '{"name":"tijmen","age":30}' http://localhost:9000
```

If everything is working correctly, you'll receive a `200 OK` JSON Response containing the posted data.

Usage
-----

[](#usage)

In order to run the asynchronous server you need to pass it three required instances:

- Connection
- RequestHandler
- Parser

### Connection

[](#connection)

A connection is necessary for the server to know to bind to. Create a new Connection instance and specify the port and IP address:

```
$connection = \TijmenWierenga\Server\Connection::init(9000, '0.0.0.0');
```

### RequestHandler

[](#requesthandler)

The RequestHandler is basically a wrapper for the application. The `handle` method receives the request and should return a response (even on an error). You can find a very simplistic example of a RequestHandler below:

```
class HelloWorld implements TijmenWierenga\Server\RequestHandler
{
    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        return new Response(200, ['Content-Type' => 'text/plain'], "Hello World!");
    }
}
```

This RequestHandler will respond with "Hello World!" anytime it receives a request.

### Parser

[](#parser)

The parser is used to parse the Request and Response body. A parser can simply format any given data into a specific format. This package comes with a DefaultParser class which is a wrapper class for [nathanmac/parser](https://github.com/nathanmac/Parser). Instantiate the DefaultParser like this:

```
$parser = new TijmenWierenga\Server\DefaultParser(new \Nathanmac\Utilities\Parser\Parser());
```

### Bringing it all together

[](#bringing-it-all-together)

```
$server = new TijmenWierenga\Server\AsyncServer($connection, $requestHandler, $parser);
$server->run();
```

Known issues
------------

[](#known-issues)

- The server can only handle a certain amount of content types
- The server cannot handle file uploads

Docker
------

[](#docker)

TODO

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3256d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8513032?v=4)[Tijmen Wierenga](/maintainers/TijmenWierenga)[@TijmenWierenga](https://github.com/TijmenWierenga)

---

Top Contributors

[![TijmenWierenga](https://avatars.githubusercontent.com/u/8513032?v=4)](https://github.com/TijmenWierenga "TijmenWierenga (5 commits)")

---

Tags

asynchronousasynchronous-php-serverdockerphppsr-7server

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tijmen-wierenga-async-php-server/health.svg)

```
[![Health](https://phpackages.com/badges/tijmen-wierenga-async-php-server/health.svg)](https://phpackages.com/packages/tijmen-wierenga-async-php-server)
```

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

42.9k337.6k1](/packages/ccxt-ccxt)[php-pm/php-pm

PHP-PM is a process manager, supercharger and load balancer for PHP applications.

6.6k446.6k8](/packages/php-pm-php-pm)[php-mcp/server

PHP SDK for building Model Context Protocol (MCP) servers - Create MCP tools, resources, and prompts

849482.3k47](/packages/php-mcp-server)[sarfraznawaz2005/servermonitor

Laravel package to periodically monitor the health of your server and website.

19613.5k1](/packages/sarfraznawaz2005-servermonitor)[discord-php/http

Handles HTTP requests to Discord servers

24345.9k11](/packages/discord-php-http)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4676.9k](/packages/tiamo-phpas2)

PHPackages © 2026

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