Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

elasticsteve's avatar

can't run queue worker - PHP fatal error

My setup is Windows 10 + PHPstorm + XAMPP (PHP 56).

When running "php artisan queue:work" from the PHPstorm terminal, I get:

PHP Fatal error: Call to undefined function Illuminate\Queue\pcntl_fork() in E:\Dropbox\PhpStorm Projects\elastic1\vendor\laravel\framework\src\Illuminate\Queue\Worker.php on line 106

[Symfony\Component\Debug\Exception\FatalErrorException] Call to undefined function Illuminate\Queue\pcntl_fork()

Any idea? thanks!

BTW, I'm using AWS SQS and have set .env to sqs and added the credentials to queue.php

0 likes
7 replies
elasticsteve's avatar

hmm.... looks like I can't install pcntl on Windows/XAMPP. This sucks!

Am I out of luck now with XAMPP/Laravel/PHPstorm? What are my options? Just had everything setup so I can use SSL/HTTPS on my dev-Apache setup for AWS/Stripe etc. because it wouldn't work with php artisan serve.

What a nightmare! All for nothing again!

Vagrant/Homestead?

jimmck's avatar

What version are you using? I just ran an update and Laravel is not using pcntl_fork()? Are you using AWS module? Process control is not available for Window's PHP builds. You need to find a library that does require pcntl extensions.

elasticsteve's avatar

Yes, it does.

These are lines 104-113 \vendor\laravel\framework\src\Illuminate\Queue\Worker.php:

protected function runNextJobForDaemon($connectionName, $queue, WorkerOptions $options)
    {
        if ($processId = pcntl_fork()) {
            $this->waitForChildProcess($processId, $options->timeout);
        } else {
            $this->runNextJob($connectionName, $queue, $options);

            exit;
        }
    }

I'm using the dev-master branch (5.3). AWS SDK installed and working.

jimmck's avatar

I am using 5.2.41. Which does not. Wow I guess they want to break Laravel for Windows users in 5.3. Nice! You should use 5.2 if you need to use that functionality and I would report that.

elasticsteve's avatar

yeah, that sucks! Gonna try it from 5.2 later... Took me ages to set up my dev environment with XAMPP and SSL/HTTPS so I can test AWS/Stripe/Nexmo. I had a real good workflow with PHPstorm.

To change everything to Vagrant/Homestead and start from scratch is quite a blow. And all this because of one function that doesn't run on Windows!

jimmck's avatar

@elasticsteve You just need to set your composer file to use 5.2. But I would go and look at AWS/Stripe/Nexmo to make sure it is compatible. Also there is a -once option to run the task once. The pnctl extension does not work on Windows. Surprising move by Laravel to up and change how it does something in a point release. But thats why I never recommend it for anything production. The change management is not dependable. Good Luck!

elasticsteve's avatar

I have a few 5.2 test projects I can try it on. But what's the point if I have to make it work with 5.3... If it really worked on Windows with 5.2, it's a bad move by Taylor. Vagrant/Homestead is not for everyone and with this it leaves no options on Windows for a Xampp dev environment, which I really enjoyed! Running everything out of the PHPstorm project folder, just showing Xampp Apache the serve folder (/public), if you don't need SSL, even php artisan serve. But I need queue workers. I don't want to SSH into a VM and all this shit of syncing PHPstorm with the VM when I don't have to.

Anyway, thanks!

PS: Just tried it with L5.2 and I can confirm everything works! Not with L5.3.

Please or to participate in this conversation.