Framework: [5.3]PHP have to --enable-pcntl if use queue

Created on 20 Aug 2016  路  13Comments  路  Source: laravel/framework

I tried this under my windows with PHP 7.0 (no way to enable pcntl):
php artisan queue:work --timeout=360 --queue=high,low --sleep=3 --tries=3
Will get this exception.

  [RuntimeException]
  The pcntl extension is required in order to specify job timeouts.

But same project in my server ( Ubuntu 16.04 with PHP 7.0 enable pcntl), it works fine.
So if it is necessary to add in "Server Requirements" ?

bug

Most helpful comment

@wdmtech Since 5.3, there was a change and pcntl extension is now required to handle jobs.

There's no Pcntl for windows so Graham did make a fix with this pull request https://github.com/laravel/framework/pull/14741

I suspect he forgot about the listener :grinning:

All 13 comments

Same...
Unfortunately pcntnl is not available for Windows based systems.

Tried to run my queue with

php artisan queue:work --daemon --sleep=1

and even

php artisan queue:listen

Getting same error... Documentation said nothing about this change, So we must either run everything under Homestead or downgrade to 5.2...

@taylorotwell What about windows users? Now we cannot use the queue system.

Windows users need to pass --timeout 0. We don't want to silently not use the timeout. If you don't want it, explicitly set it to 0 to disable it.

Gah! changing --timeout=0 to --timeout 0 did the trick thanks, it works now

@GrahamCampbell @taylorotwell we should maybe at a note on the docs regarding this issue.

Or we could just update the exception message to say turn the timeout off if you don't want timeouts?

Yeah might be better.

@gholol - I seem to be getting the same message using either syntax:

image

This is on an 5.2-5.3 upgraded project - I'll try a fresh 5.3 project too.


EDIT: Yep - same issue. No error with php artisan queue:work --timeout 0 however.

@wdmtech It doesn't work with queue listener, you have to use worker.

php artisan queue:work --daemon --timeout 0

Thanks @gholol. I got it working that way.

Interesting, any idea why not?

It has --timeout as an option

image

@wdmtech Since 5.3, there was a change and pcntl extension is now required to handle jobs.

There's no Pcntl for windows so Graham did make a fix with this pull request https://github.com/laravel/framework/pull/14741

I suspect he forgot about the listener :grinning:

Yes looks like we just need to handle fix this on the listen command maybe @GrahamCampbell? Can someone send over a PR?

I didn't forget about it as such. I just didn't expect anyone to want to use it.

I mean, we can fix it. :P

Was this page helpful?
0 / 5 - 0 ratings