EvanAgee Posted September 10, 2008 Share Posted September 10, 2008 So I've got a data import script that can potentially run very long as it handles downloading of images via URLs as well as importing large amounts of data (15,000+ lines) from Excel. So what's the best way to make sure that the script actually runs to completion and doesn't time out? I've been using sleep() is that the best way? Link to comment https://forums.phpfreaks.com/topic/123544-best-way-to-handle-long-running-scripts/ Share on other sites More sharing options...
discomatt Posted September 10, 2008 Share Posted September 10, 2008 set_time_limit( 0 ) Link to comment https://forums.phpfreaks.com/topic/123544-best-way-to-handle-long-running-scripts/#findComment-638040 Share on other sites More sharing options...
lisa71283 Posted September 10, 2008 Share Posted September 10, 2008 set_time_limit(0) may not be available to you if you are on shared hosting. Additionally, when you are using PHP to perform large tasks on a manual basis, you should always ignore_user_abort(true) to prevent a network problem from killing your script halfway through execution. Link to comment https://forums.phpfreaks.com/topic/123544-best-way-to-handle-long-running-scripts/#findComment-638050 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.