MidOhioIT Posted April 13, 2010 Share Posted April 13, 2010 I have a newsletter system that is coded with php to mysql. It is trying to do almost 60,000 emails. Everything works fine except at around 2,000 emails which is around 2-3 hours worth of processing the script always seems to stop running. is there a setting or a command that I can run to keep it running until the end? I can provide the code if needed but thought maybe it is a simple comand i can just insert (i hope) Quote Link to comment https://forums.phpfreaks.com/topic/198363-php-that-stops-executing-after-2-hours/ Share on other sites More sharing options...
Daniel0 Posted April 13, 2010 Share Posted April 13, 2010 Run it from the command line and make sure that you give it enough memory. Quote Link to comment https://forums.phpfreaks.com/topic/198363-php-that-stops-executing-after-2-hours/#findComment-1040847 Share on other sites More sharing options...
JAY6390 Posted April 13, 2010 Share Posted April 13, 2010 put set_time_limit(0); at the top of the script. To be honest you would be better queueing these up in a mysql table and sending them in small batches every so many minutes (say 200 every 15 minutes) and help spread the load over time - That plus you can have the same script running multiple times. By your current guesses the 60000 could last between 60 to 90 hours, which is madness to be honest Quote Link to comment https://forums.phpfreaks.com/topic/198363-php-that-stops-executing-after-2-hours/#findComment-1040851 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.