Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the max. execution time of a php artisan command

Tags:

php

laravel-4

I am just wondering, what is the maximum execution time of a laravel artisan command?

Is it unlimited like php shell scripts or does artisan / laravel have some kind of protection for unlimited looped commands?

Because I wanna make a command that runs forever, as long as the server is running. Is that possible with Laravel Artisan?

thanks

like image 601
mfsymb Avatar asked Oct 21 '25 04:10

mfsymb


2 Answers

i am just wondering, what is the maximum execution time of a laravel artisan command?

If you run it via the command line - it can be indefinite.

Is it unlimited like php shell scripts or dose artisan / laravel have some kind of protection for unlimited looped commands?

There is no protection - you are free to do what you want.

because i wanna make a command that runs forever, as long as the server is running. Is that possible with Laravel Artisan?

I do something similar - I have a php artisan command that has currently been running for 89 days without issue so far. But as Aross mentioned below, the problem is that if the command does fail for some reason, you need to know about it.

like image 188
Laurence Avatar answered Oct 23 '25 18:10

Laurence


The default is zero, means no time limit. Even though maximum execution time is 30 by default, this does not affect to command line processes.

Check the documentation from here :- http://php.net/manual/en/info.configuration.php#ini.max-execution-time

Hope this helps, Cheers!

like image 31
Anjana Silva Avatar answered Oct 23 '25 18:10

Anjana Silva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!