PHPackages                             marcj/php-pm - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. marcj/php-pm

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

marcj/php-pm
============

4991PHP

Since Mar 21Pushed 10y ago1 watchersCompare

[ Source](https://github.com/marcj/php-pm)[ Packagist](https://packagist.org/packages/marcj/php-pm)[ RSS](/packages/marcj-php-pm/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

PPM - PHP Process Manager
=========================

[](#ppm---php-process-manager)

[![](https://avatars3.githubusercontent.com/u/11821812?v=3&s=200)](https://avatars3.githubusercontent.com/u/11821812?v=3&s=200)

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

It's based on ReactPHP and works best with applications that use request-response frameworks like Symfony's HTTPKernel. The approach of this is to kill the expensive bootstrap of PHP (declaring symbols, loading/parsing files) and the bootstrap of feature-rich frameworks. See Performance section for a quick hint. PHP-PM basically spawns several PHP instances as worker bootstraping your application (eg. the whole Symfony Kernel) and hold it in the memory to be prepared for every incoming request: This is why PHP-PM makes your application so fast.

More information can be found in the article: [Bring High Performance Into Your PHP App (with ReactPHP)](http://marcjschmidt.de/blog/2014/02/08/php-high-performance.html)

### Features

[](#features)

- Performance boost up to 15x (compared to PHP-FPM, Symfony applications).
- Integrated load balancer.
- Hot-Code reload (when PHP files changes).
- Static file serving for easy development procedures.
- Support for HttpKernel (Symfony/Laravel), Drupal (experimental), Zend (experimental).

### Why using PPM as development server instead of vagrant, nginx or apache?

[](#why-using-ppm-as-development-server-instead-of-vagrant-nginx-or-apache)

- No hassle with file permissions (www-data vs local user ids).
- No painful slow virtual-box file sync.
- Faster response times of your PHP app.
- No fighting with vagrant / virtual machine settings.
- Checkout a new project, run `ppm start` - done. (if configured with `ppm config`)
- No hassle with domain names (/etc/hosts), just use different ports for your app without root access.

### Installation

[](#installation)

To get PHP-PM you need beside the php binary also php-cgi, which comes often with php. If not availabe try to install it:

**Debian/Ubuntu** ()

`apt-get install php7.0-cgi`

**Mac OS X - Homebrew** ()

`brew install php70`

**Mac OS X - Macports**

`port install php70-cgi`

By default, PPM looks for a binary named `php-cgi`. If your PHP installation uses a different binary name, you can specify the full path to that binary with the `php-cgi`configuration option (for example: `ppm config --php-cgi=/opt/local/bin/php-cgi70`).

#### Global

[](#global)

```
$ git clone git@github.com:php-pm/php-pm.git
$ cd php-pm
$ composer install
$ ln -s `pwd`/bin/ppm /usr/local/bin/ppm
$ ppm --help
```

#### Per project

[](#per-project)

```
# change minimum-stability to dev in your composer.json (until we have a version tagged): "minimum-stability": "dev"
composer require php-pm/php-pm:dev-master
composer require php-pm/httpkernel-adapter:dev-master #if you have httpkernel (laravel, symfony)
./vendor/bin/ppm config --bootstrap=symfony #places a ppm.json in your directory
./vendor/bin/ppm start #reads ppm.json and starts the server like you want
```

Once configured (composer and ppm.json) you can start your app on your development machine or server instantly:

```
composer install
./vendor/bin/ppm start
```

When `debug` is enabled, PHP-PM detects file changes and restarts its worker automatically.

#### Performance &amp; Debugging tips

[](#performance--debugging-tips)

To get the maximum performance you should usually use `--app-env=prod` with disabled debug `--debug=0`. Also make sure xdebug is disabled. Try with different amount of workers. Usually a 10% over your cpu core count is good. Example: If you have 8 real cores (excl. hyper-threading) use `--workers=9`.

If your applications supports it, try enabled concurrent requests per worker: `--concurrent-requests=1`.

To get even more performance (for static file serving or for rather fast applications) try a different event loop:

If you get strange issues in your application and you have no idea where they are coming from try using only one worker `--workers=1`.

### Adapter

[](#adapter)

**HttpKernel for Symfony/Laravel** -

**Drupal** -

**Zend** -

### Command

[](#command)

[![ppm-help](https://camo.githubusercontent.com/57786a31bb975a6032b5f564d4e0b0f2fd82f0e188d44a1417a98226b35f25d9/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f35343036393236332f70706d2d6769746875622f68656c702d73637265656e73686f742e706e67)](https://camo.githubusercontent.com/57786a31bb975a6032b5f564d4e0b0f2fd82f0e188d44a1417a98226b35f25d9/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f35343036393236332f70706d2d6769746875622f68656c702d73637265656e73686f742e706e67)

Start

```
cd ~/my/path/to/symfony/
ppm start

ppm start ~/my/path/to/symfony/ --bootstrap=Symfony --bridge=HttpKernel

cd ~/my/path/to/symfony/
./vendor/bin/ppm start
```

[![ppm-start](https://camo.githubusercontent.com/8867bd8488b556673997b40ef8efc864e60c761f534306b9b7a8e81ed1a924a1/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f35343036393236332f70706d2d6769746875622f73746172742d636f6d6d616e642e706e67)](https://camo.githubusercontent.com/8867bd8488b556673997b40ef8efc864e60c761f534306b9b7a8e81ed1a924a1/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f35343036393236332f70706d2d6769746875622f73746172742d636f6d6d616e642e706e67)

#### Symfony

[](#symfony)

```
cd my-project
composer require php-pm/httpkernel-adapter:dev-master
$ ./bin/ppm start --bootstrap=symfony
```

#### Laravel

[](#laravel)

```
cd my-project
composer require php-pm/httpkernel-adapter:dev-master
$ ./vendor/bin/ppm start --bootstrap=laravel
```

#### Drupal

[](#drupal)

```
cd my-project
composer require php-pm/httpkernel-adapter:dev-master
$ ./bin/ppm start --bootstrap=drupal
```

#### Zend

[](#zend)

```
cd my-project
composer require php-pm/zend-adapter:dev-master
$ ./bin/ppm start --bridge=Zf2 --bootstrap=Zf2
```

Each worker starts its own HTTP Server which listens on port 5501, 5502, 5503 etc. Range is `5501 -> 5500+`. You can integrate those workers directly in a load balancer like NGINX or use  directly.

### Performance

[](#performance)

6x3,2 GHz Intel, 16GB RAM. 20 concurrent, 1000 total request: `ab -c 20 -n 1000 http://127.0.0.1:8080/`

#### PHP 7, StreamSelectLoop

[](#php-7-streamselectloop)

```
/usr/local/bin/php7 ./bin/ppm start ~/www/symfony--bridge=httpKernel --app-env=prod --logging=0 --debug=0 --workers=8

Static file: 2371.93 requests/s
Dynamic CMS application: 1685.80 request/s (http://jarves.io)

```

#### PHP 5.6.18, StreamSelectLoop

[](#php-5618-streamselectloop)

```
/usr/local/bin/php5 ./bin/ppm start ~/www/symfony --bridge=httpKernel --app-env=prod --logging=0 --debug=0 --workers=8

Static file: 1818.52 requests/s
Dynamic CMS application: 1270.30 request/s (http://jarves.io)

```

### Issues

[](#issues)

- Memory leaks, memory leaks and memory leaks. You will find also leaks in your application. :)
- Does not work with ExtEventLoop. (So don't install `php70-event`)
- Drupal is very experimental and not fully working. Try using .
- Symfony's and Laravel's profiler aren't working yet perfectly since it's still needed to reset some stuff after each request.
- Streamed responses are not streamed yet
- File upload is experimental
- No windows support due to signal handling
- Doesn't fully implement HTTP/1.1, but [reactphp/http](https://github.com/reactphp/http) is working on it.

Please help us to fix those issues by creating pull requests. :)

### Setup 1. Use external Load-Balancer

[](#setup-1-use-external-load-balancer)

[![ReactPHP with external Load-Balancer](doc/reactphp-external-balancer.jpg)](doc/reactphp-external-balancer.jpg)

Example config for NGiNX:

```
upstream backend  {
    server 127.0.0.1:5501;
    server 127.0.0.1:5502;
    server 127.0.0.1:5503;
    server 127.0.0.1:5504;
    server 127.0.0.1:5505;
    server 127.0.0.1:5506;
}

server {
    root /path/to/symfony/web/;
    server_name servername.com;
    location / {
        try_files $uri @backend;
    }
    location @backend {
        proxy_pass http://backend;
    }
}
```

### Setup 2. Use internal Load-Balancer

[](#setup-2-use-internal-load-balancer)

This setup is slower as we can't load balance incoming connections as fast as NGiNX it does, but it's perfect for testing purposes.

[![ReactPHP with internal Load-Balancer](doc/reactphp-internal-balancer.jpg)](doc/reactphp-internal-balancer.jpg)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/974147f78bc18a1b3838b2959678bab84bb15ce12b79ecb638c8444ff05bf3c3?d=identicon)[MArcJ](/maintainers/MArcJ)

---

Top Contributors

[![marcj](https://avatars.githubusercontent.com/u/450980?v=4)](https://github.com/marcj "marcj (41 commits)")[![andig](https://avatars.githubusercontent.com/u/184815?v=4)](https://github.com/andig "andig (14 commits)")[![trq](https://avatars.githubusercontent.com/u/32683?v=4)](https://github.com/trq "trq (14 commits)")[![itcreator](https://avatars.githubusercontent.com/u/928509?v=4)](https://github.com/itcreator "itcreator (2 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (2 commits)")[![cryptiklemur](https://avatars.githubusercontent.com/u/896295?v=4)](https://github.com/cryptiklemur "cryptiklemur (2 commits)")[![m14t](https://avatars.githubusercontent.com/u/207950?v=4)](https://github.com/m14t "m14t (1 commits)")[![dankocherga](https://avatars.githubusercontent.com/u/157042?v=4)](https://github.com/dankocherga "dankocherga (1 commits)")[![mre](https://avatars.githubusercontent.com/u/175809?v=4)](https://github.com/mre "mre (1 commits)")[![sebcode](https://avatars.githubusercontent.com/u/508999?v=4)](https://github.com/sebcode "sebcode (1 commits)")[![andrei-stsiapanau](https://avatars.githubusercontent.com/u/179284?v=4)](https://github.com/andrei-stsiapanau "andrei-stsiapanau (1 commits)")[![gnugat](https://avatars.githubusercontent.com/u/793185?v=4)](https://github.com/gnugat "gnugat (1 commits)")[![Im0rtality](https://avatars.githubusercontent.com/u/1804210?v=4)](https://github.com/Im0rtality "Im0rtality (1 commits)")

### Embed Badge

![Health badge](/badges/marcj-php-pm/health.svg)

```
[![Health](https://phpackages.com/badges/marcj-php-pm/health.svg)](https://phpackages.com/packages/marcj-php-pm)
```

###  Alternatives

[grrr-amsterdam/garp-functional

Utility library embracing functional programming paradigms.

32116.1k5](/packages/grrr-amsterdam-garp-functional)

PHPackages © 2026

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