PHPackages                             puper/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. puper/php-pm

ActiveLibrary

puper/php-pm
============

00PHP

Since Apr 26Pushed 9y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)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.

[![Build Status](https://camo.githubusercontent.com/c9a08936c802cd4aaa71dabf85d65e32e6a5b389fa5b0674752bc1b468e32d4e/68747470733a2f2f7472617669732d63692e6f72672f7068702d706d2f7068702d706d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/php-pm/php-pm)[![Gitter](https://camo.githubusercontent.com/27e5750d7e9d727c83daab840af8b9831df6ea10919ff93c172063ecbd940ffa/68747470733a2f2f6261646765732e6769747465722e696d2f7068702d706d2f7068702d706d2e737667)](https://gitter.im/php-pm/php-pm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

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 change).
- 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.

### Badge all the things

[](#badge-all-the-things)

Does your app/library support PPM? Show it!

[![PPM Compatible](https://raw.githubusercontent.com/php-pm/ppm-badge/master/ppm-badge.png)](https://github.com/php-pm/php-pm)

```
[![PPM Compatible](https://raw.githubusercontent.com/php-pm/ppm-badge/master/ppm-badge.png)](https://github.com/php-pm/php-pm)

```

### Installation

[](#installation)

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

**Debian/Ubuntu** ()

`apt-get install php7.0-cgi`

By default cgi bin is in `/usr/lib/cgi-bin/php`, so you need to run:

`sudo ln -s /usr/lib/cgi-bin/php /usr/bin/php7.0-cgi`

**Red Hat/Centos (RHEL-7, 6)** ()

install Webtatic first

`yum install php70w-cli`

**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 --cgi-path=/opt/local/bin/php-cgi70`).

On Ubuntu for example per default `pcntl_*` functions are disabled. If you get `Warning: pcntl_signal() has been disabled for security reasons`, you should activate these functions:

Open `/etc/php5/cgi/php.ini`, find line `disable_functions = pcntl_alarm,pcntl_fork, ...` and place a `;` in front of it:

```
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
;disable_functions = pcntl_alarm,pcntl_fork, ...

```

#### Global

[](#global)

```
$ git clone https://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

[](#performance)

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 (see ).

#### Debugging

[](#debugging)

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` and enable `-v` or `-vv`.

When debugging you should use xdebug as you're used to. If you set a break point and hold the application, then only one worker is stopped until you release the break point. All other workers are fully functional.

**Note for XDebug and PHPStorm**: Since php-pm uses at least two processes, there are two xdebug instances as well. PHPStorm is per default configured to only accept one connection at a time. You need to increase that. You won't get xdebug working with your application if you don't increase that count.

[![Xdebug and PHPStorm](https://camo.githubusercontent.com/aa51f729258748eac46c15d78273c3d07cfc3650ea46cbfba2f863515b5660c9/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f35343036393236332f70706d2d6769746875622f7864656275672d70687073746f726d2e706e67)](https://camo.githubusercontent.com/aa51f729258748eac46c15d78273c3d07cfc3650ea46cbfba2f863515b5660c9/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f35343036393236332f70706d2d6769746875622f7864656275672d70687073746f726d2e706e67)

In all workers the STDOUT is redirected to the connected client. So take care, `var_dump`, `echo` are not displayed on the console. STDERR is not redirected to the client, but to the console. So, for very simple debugging you could use `error_log('hi')` and you'll see it on the console. Per default exceptions and errors are only displayed on the console, prettified with Symfony/Debug component.

### 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
```

#### Wordpress

[](#wordpress)

For all Wordpress lovers out there: PPM is not going to work with Wordpress due to the lack of request-response abstraction. We highly doubt that Wordpress is ever going to be compatible because its architecture is written in a way that makes it currently impossible to serve multiple requests in one application process.

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 (requests/s)

[](#performance-requestss)

6x4GHz Intel i7, 16GB RAM. 10 concurrent, 1000 total request: `ab -c 10 -n 1000 http://127.0.0.1:8080/`

#### Symfony, CMS application

[](#symfony-cms-application)

`ppm start --bootstrap=symfony --app-env=prod --logging=0 --debug=0 --workers=20`

PHP VersionDynamic at JarvesStatic file7.0.3, StreamSelectLoop2387,673944,525.6.18, StreamSelectLoop1663,562636,095.6.18, LibEventLoop1811,763441,72#### Laravel, example package

[](#laravel-example-package)

`ppm start --bootstrap=laravel --app-env=prod --debug=0 --logging=0 --workers=20`

[![](https://camo.githubusercontent.com/d0d9de6e26c198268bf71f61369a2f22ff719bd5ae4a7b52af3ec4dc24f635ad/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f35343036393236332f70706d2d6769746875622f6c61726176656c2e706e67)](https://camo.githubusercontent.com/d0d9de6e26c198268bf71f61369a2f22ff719bd5ae4a7b52af3ec4dc24f635ad/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f35343036393236332f70706d2d6769746875622f6c61726176656c2e706e67)

Issues
------

[](#issues)

- Not production ready yet, as it's in development and still needs some work in the bootstrap classes of supported frameworks. Some people are currently trying to use it in production. Stay tuned :)
- Memory leaks, memory leaks and memory leaks. You will also find leaks in your application. :) But no big issue since workers restart automatically.
- Does not work with ExtEventLoop. (So don't install `php70-event`, but you can try LibEventLoop `php56-libevent`)
- Drupal and Zend is very experimental and not fully working. Try using .
- Laravel's debugger isn't working perfectly yet 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 fix these issues by creating pull requests. :)

### Setup 1. Use NGINX

[](#setup-1-use-nginx)

Example config for NGINX:

```
server {
    root /path/to/symfony/web/;
    server_name servername.com;
    location / {
        try_files $uri @ppm;
    }
    location @ppm {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://127.0.0.1:8080;
    }
}
```

To get the real remote IP in your Symfony application for example, don't forget to add ppm (default `127.0.0.1`) as trusted reverse proxy.

```
# app/config/config.yml
# ...
framework:
    trusted_proxies:  [127.0.0.1]
```

More information at [http://symfony.com/doc/current/cookbook/request/load\_balancer\_reverse\_proxy.html](http://symfony.com/doc/current/cookbook/request/load_balancer_reverse_proxy.html).

### Setup 2. Use PPM directly

[](#setup-2-use-ppm-directly)

Since PPM has also a static file server (which isn't quite as fast as nginx, but works for basic usage, see Performance section), you can use PPM directly on your server or local. Do not run ppm as root (to get port like 80 working), as it does not set a new UID of the current process and would run all the time as root, which is highly unrecommended.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.6% 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/82741acf25ca1b39fae7cff93d82fa41bab31554025df311a8ebfc1878f17d42?d=identicon)[puper](/maintainers/puper)

---

Top Contributors

[![marcj](https://avatars.githubusercontent.com/u/450980?v=4)](https://github.com/marcj "marcj (96 commits)")[![andig](https://avatars.githubusercontent.com/u/184815?v=4)](https://github.com/andig "andig (20 commits)")[![trq](https://avatars.githubusercontent.com/u/32683?v=4)](https://github.com/trq "trq (14 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (4 commits)")[![emielmolenaar](https://avatars.githubusercontent.com/u/2470795?v=4)](https://github.com/emielmolenaar "emielmolenaar (2 commits)")[![maciejmrozinski](https://avatars.githubusercontent.com/u/1927895?v=4)](https://github.com/maciejmrozinski "maciejmrozinski (2 commits)")[![Ingramz](https://avatars.githubusercontent.com/u/1017132?v=4)](https://github.com/Ingramz "Ingramz (2 commits)")[![itcreator](https://avatars.githubusercontent.com/u/928509?v=4)](https://github.com/itcreator "itcreator (2 commits)")[![cryptiklemur](https://avatars.githubusercontent.com/u/896295?v=4)](https://github.com/cryptiklemur "cryptiklemur (2 commits)")[![kugu](https://avatars.githubusercontent.com/u/1143254?v=4)](https://github.com/kugu "kugu (1 commits)")[![m14t](https://avatars.githubusercontent.com/u/207950?v=4)](https://github.com/m14t "m14t (1 commits)")[![mre](https://avatars.githubusercontent.com/u/175809?v=4)](https://github.com/mre "mre (1 commits)")[![PabloJoan](https://avatars.githubusercontent.com/u/9193314?v=4)](https://github.com/PabloJoan "PabloJoan (1 commits)")[![radarhere](https://avatars.githubusercontent.com/u/3112309?v=4)](https://github.com/radarhere "radarhere (1 commits)")[![sebcode](https://avatars.githubusercontent.com/u/508999?v=4)](https://github.com/sebcode "sebcode (1 commits)")[![xoeoro](https://avatars.githubusercontent.com/u/6437303?v=4)](https://github.com/xoeoro "xoeoro (1 commits)")[![acasademont](https://avatars.githubusercontent.com/u/825021?v=4)](https://github.com/acasademont "acasademont (1 commits)")[![youanden](https://avatars.githubusercontent.com/u/183880?v=4)](https://github.com/youanden "youanden (1 commits)")[![andrei-stsiapanau](https://avatars.githubusercontent.com/u/179284?v=4)](https://github.com/andrei-stsiapanau "andrei-stsiapanau (1 commits)")[![andytson](https://avatars.githubusercontent.com/u/199783?v=4)](https://github.com/andytson "andytson (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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