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

andyandy's avatar

Running Queue with continuously running PHP script

I'm dealing with a managed server, that doesn't have supervisor. And I have to run Queue.

However this hosting is offering continuously running PHP script. I was suggested to use exec in that file. How would I go about that? Just creating file with:

<?php
exec('php /var/www/example.com queue:work');

And setting this script up to run continuously? I can't find anything on Google about this.

0 likes
2 replies
Sinnbeck's avatar

If nothing else is possible, then I suppose that is the only way. Just remember to ask them how to restart it

Remember, queue workers, are long-lived processes and store the booted application state in memory. As a result, they will not notice changes in your code base after they have been started

martinbean's avatar

@andyandy A queue worker is a long-running process. PHP scripts can easily be killed.

If you need to run a queue and your host doesn’t allow you to run arbitrary processes and a monitoring service like Supervisor, then find one that does.

Please or to participate in this conversation.