Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 command line app is "Killed" after a few minutes

I have a Symfony2 command line app that I've built. It fetches a ton of data from a web service to pre-cache. I'm running into a problem where after about 5 minutes the app is "Killed".

I run the command:

php app/console FTW:loadAuctionHouse

My application outputs its steps while running, and just outputs "Killed" all of a sudden after a few minutes.
So... question: Is there a built in time limit to the command line apps? Or is there something "funky" going on? Can someone explain why this could happen?

like image 994
Chris Avatar asked Nov 04 '22 12:11

Chris


1 Answers

As every php application (cli as well as apache or anything else) there is a execution time limit. Add

set_time_limit(0);

to your command line tool to prevent this. CAUTION: This will result in a script that runs till infinity if caught in an endless loop or some recursion loop. While this solution is better than increasing the script execution time in your php.ini, it should be done only when really neccessary.

like image 182
Sgoettschkes Avatar answered Nov 15 '22 10:11

Sgoettschkes