PHP Script Getting stopped without Any error

November 21, 2014 1.4k views


I have just installed a LAMP stack. Everything is working fine. I have a PHP script that crawl web pages and fetch data through filegetcontents. I have change the maxexecutiontime to 9999. I run the script on my local computer and it runs fine here(It ran for 4 Hours). But on Digital Ocean the script stop after certain time. Something around 5-6 minutes. I check the Apache error_log and I cannot see any error that tell why the script has been stopped. Can you please tell if you have implemented any Limits or Anything that I missed in the configuration ?

2 Answers

How about running php script directly?

php -f script.php > script.out 2> script.err
  • I didn't try that but after talking with support and checking the console it looks like my script is using the Maximum Ram allocated(512MB) for my droplet and thats why Apache was getting killed. And I think that is why I didn't saw anything in the PHP error logs.

Have another answer? Share your knowledge.