Laravel Horizon, ext-pcntl and Windows

Update 2: You may want to use Docke for your local development. You could use these Tools: or

Update: As of version 1.0.1 laravel does require ext-posix via composer.json as well. I’ve updated the post to take care of this requirement.

As I start using Laravel’s newest package Horizon (Introduced by Taylor Otwell on Medium or at to control app’s queues, I was annoyed due to a windows related problem, pcntl (PHP’s process controlling module). And since version 1.0.1 the posix extension is required as well, which is also not available on windows.

After creating a new Laravel 5.5 project and adding horizon I got this error:

By lookup the error I quickly learned, pcntl doesn’t like windows at all. Therefore I needed a workaround.

Ignore all platform requirements

The simplest way to install the dependencies anyway, is to ignore all platform related requirements using the option  --ignore-platform-reqs

But this is a bit hard, what happen if any another package needs a PHP module that is available for windows? Not a productive-like solution I think.

Ingore the module pctnl and posix

Composer supports using the option  --ignore-platform-reqs and additionally specifiy which packages/modules to ignore. So you can run the following command for each install/update:

But then, everyone using your app needs to know that just to run some queue admin panel. Not really proportionate.

Configure ignorance in composer.json

I finnaly came up with ignoring just the pcntl module at all directly in the composer.json file, since it’s not critical to run my app, only to run horizon.

The version of ext-pcntl and ext-posix is similar to the version of php I’m using. In my tests the version  newer received any attention…

But notice: You are now responsible to install/enable pcntl on your prod server to be able to use it.

6 thoughts on “Laravel Horizon, ext-pcntl and Windows

  1. typo in comand
    composer install –iNGore-platform-reqs ext-pcntl
    need to be replaced with

    composer install –ignore-platform-reqs ext-pcntl

Leave a Reply

Your email address will not be published. Required fields are marked *