raphael75 Posted February 27, 2014 Share Posted February 27, 2014 I have a PHP script that runs in a WIMP environment. The script contacts several remote locations, retrieves data, and then attempts to insert it into our MySQL database. The script is set to run each morning at 5:45am, 6:42am, and 7:42am. The steps: contact store get data delete all old data present for the current store for the current day insert new data I have the script log what it's doing.The problem is that more than half the time when it runs on the scheduled task, it contacts the 1st store and the script stops working when it tries to delete the old data. **However, when I manually run it from the command line it always works.** What could cause the script to stop working when run as a scheduled task? I'm not sure if this matters, but the table contains over 2 million rows. Thanks! Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted February 27, 2014 Share Posted February 27, 2014 best guess is the php.ini settings are different between running as a scheduled task and via the command line and you are running up against the max_execution_time value. do you have php's error_reporting set to E_ALL and log_errors set to ON so that all php errors will be logged? also, are you checking if each query is failing and logging the reason why? you could also log the ini_get('max_execution_time'); value to see if it is different between running as a scheduled task and via the command line. you could also capture and log/store to a file the phpinfo(INFO_GENERAL) output to see if any php.ini is being used and/or log/store to a file the complete phpinfo() output and compare them to see if there are any differences. Quote Link to comment Share on other sites More sharing options...
raphael75 Posted February 27, 2014 Author Share Posted February 27, 2014 Thanks for the tips! I will try all of those and see what I can find. Quote Link to comment 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.