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

thebigk's avatar
Level 13

PHP FPM and PHP CLI - What handles Artisan Commands?

I'm curious to know if the Artisan commands are handled by PHP-CLI OR PHP-FPM. The context of the question is this -

I'm required to run an Artisan command every few seconds. Now my CRON won't go sub-minutes; and therefore I'm thinking of using a loop with sleep(x) -

foreach($items as $item) {
    sleep(15);
    Artisan::call('some-command');
}

I noticed that while this code executes, I can actually access various parts of my site without any delay; as if there is no connection between the execution of the above loop and browsing.

I concluded that Artisan command was handled by php-cli and my web requests were handled by fpm. Am I right?

0 likes
2 replies
wondertalik's avatar

I concluded that Artisan command was handled by php-cli and my web requests were handled by fpm. Am I right?

Yes, you are right. Artisan always use php-cli.

1 like
hthanhbmt's avatar

How can we use php-fpm for queues? Because there are a few configs we can add to php-fpm configuration and it doesn't have in php-cli

Please or to participate in this conversation.