PHPackages                             steevanb/php-parallel-processes - 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. steevanb/php-parallel-processes

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

steevanb/php-parallel-processes
===============================

Call processes in parallel

1.2.0(2mo ago)13.6k↓50%[10 issues](https://github.com/steevanb/php-parallel-processes/issues)[1 PRs](https://github.com/steevanb/php-parallel-processes/pulls)Apache-2.0PHPPHP ^8.2CI passing

Since Sep 9Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/steevanb/php-parallel-processes)[ Packagist](https://packagist.org/packages/steevanb/php-parallel-processes)[ RSS](/packages/steevanb-php-parallel-processes/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (31)Used By (0)

[![Version](https://camo.githubusercontent.com/e795b80500b2437fcc432185d4007e91e47acdff23ac6644e3f610026176dc55/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e322e302d626c756576696f6c65742e737667)](https://github.com/steevanb/php-parallel-processes/tree/1.2.0)[![PHP](https://camo.githubusercontent.com/acffb6ae1962992d26e4466782832787e79504a6250f80d732c4283458b9f497/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c75652e737667)](https://php.net)[![Lines](https://camo.githubusercontent.com/97a6da3c0a9f76dcb8a686bbe74534712b51058b4be76eff7046af57d0436606/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532306c696e65732d362c3634392d626c75652e737667)](https://camo.githubusercontent.com/97a6da3c0a9f76dcb8a686bbe74534712b51058b4be76eff7046af57d0436606/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532306c696e65732d362c3634392d626c75652e737667)[![Downloads](https://camo.githubusercontent.com/b0a423b0dabed1bdff0861b1ff433083d823af70ac38261c1f43347bed30e27d/68747470733a2f2f706f7365722e707567782e6f72672f7374656576616e622f7068702d706172616c6c656c2d70726f6365737365732f646f776e6c6f616473)](https://camo.githubusercontent.com/b0a423b0dabed1bdff0861b1ff433083d823af70ac38261c1f43347bed30e27d/68747470733a2f2f706f7365722e707567782e6f72672f7374656576616e622f7068702d706172616c6c656c2d70726f6365737365732f646f776e6c6f616473)[![GitHub workflow status](https://camo.githubusercontent.com/147d8df5115c75e29f9d694ae5b976a8fde13c87d50b39e143e3b87e015fef5a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7374656576616e622f7068702d706172616c6c656c2d70726f6365737365732f63692e796d6c3f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/147d8df5115c75e29f9d694ae5b976a8fde13c87d50b39e143e3b87e015fef5a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7374656576616e622f7068702d706172616c6c656c2d70726f6365737365732f63692e796d6c3f6272616e63683d6d6173746572)[![Coverage](https://camo.githubusercontent.com/612c06e7e4776ec810436be46497c63611805f977fa9896464a9798d6468d741/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d34362532352d737563636573732e737667)](https://camo.githubusercontent.com/612c06e7e4776ec810436be46497c63611805f977fa9896464a9798d6468d741/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d34362532352d737563636573732e737667)

php-parallel-processes
======================

[](#php-parallel-processes)

Execute processes in parallel.

Examples of use: start your environment, CI tools...

Installation
============

[](#installation)

Use official Docker image
-------------------------

[](#use-official-docker-image)

You can use the official Docker image to not install anything: [steevanb/php-parallel-processes:x.y.z](https://hub.docker.com/r/steevanb/php-parallel-processes/tags).

Example:

```
docker \
    run \
        --rm \
        --tty \
        --interactive \
        --volume "$(pwd)":"$(pwd)" \
        --workdir "$(pwd)" \
        steevanb/php-parallel-processes:x.y.z \
        php parallel-processes.php
```

### If your processes use docker

[](#if-your-processes-use-docker)

If processes in `parallel-processes.php` use Docker, you have to add a volume on your Docker socket:

```
--volume /var/run/docker.sock:/var/run/docker.sock
```

All official `php-parallel-processes` images have Docker and Docker compose installed, so you only need to add a volume on the socket.

### alpine, bookworm and buster

[](#alpine-bookworm-and-buster)

3 Docker images are provided for each `php-parallel-processes` version, use the one you want depending on your needs:

- `alpine`: smaller version, but could be "too much simple" sometimes
- `buster`: middle version, contains almost everything needed
- `bookworm`: larger version, should contain what you need

Install as Composer dependency
------------------------------

[](#install-as-composer-dependency)

If you want to add `php-parallel-processes` directly in your project:

```
composer require steevanb/php-parallel-processes ^1.2
```

Create processes configuration
==============================

[](#create-processes-configuration)

You need to create a configuration for your processes, written in PHP.

Example: [bin/start.php](bin/start.php)

Basic example
-------------

[](#basic-example)

```
