Jump to content

php that stops executing after 2 hours


MidOhioIT

Recommended Posts

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)

Link to comment
https://forums.phpfreaks.com/topic/198363-php-that-stops-executing-after-2-hours/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.