Typically problems with scripts failing to run from cron can be tracked back to environment variables. When you run it from the shell, you have the users env variables set. When it runs from cron, it (typically) has a slightly different environment.
A simple way to test it is to get your shell environment vars with the 'set' command And then run the 'set' command via cron (or at). You can do something like "at now", enter 'set' and cntl-d. The output will be mailed back to the user that ran the command. Look for differences. They probally are the source. <c> -----Original Message----- From: Pablo Gosse [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 22, 2004 2:35 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Strange errors when PHP script called from CRON Marek Kilimajer wrote: [snip] >>> Perhaps. Could the data being utilized by the code occasionally have >>> characters that should be escaped, by aren't? Are you escaping all >>> of the escapable characters, especially quotes, both single and >>> double? >> >> >> That's what I was thinking initially, but all code that is submitted >> to or extracted from the database is encoded using the translation >> table from get_html_translation_table plus an additional translation >> which I manually apply to replace ' with \'. >> >> Also, I'm reluctant to think that the problem lies here because once >> a page has been scheduled to be published, it is not removed from >> this schedule unless the owner of the page does so. >> >> Basically, if a page is scheduled to be published, and some data in >> the page caused the error, the error should show up indefinitely, or >> until the person has removed the scheduled publishing of the page, >> since the page will not be removed from the publishing schedule due >> to the error causing the script to stop executing. >> >> Also, if you take a look at the error below in particular, >> >> Parse error: parse error, expecting `')'' in >> /u0/path/to/classes/adodb/adodb-time.inc.php on line 850 LINE 850: >> $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31); >> >> You'll see that this is a portion of code that utilizes no external >> data whatsoever, and is actually in a file (adodb-time.inc.php) which >> is never called by my script, but is called internally by ADODB. >> >> In nearly four years of working with PHP, this is the first time I've >> ever been completely stumped. >> >> Any other ideas? > Is any of the files updated at all? It could be a race condition, > happened to me few times - I upload a file to the server, impatiently > reload the page and get parse error. I reload once again and > everything is fine. [/snip] The files from the ADODB class which are throwing errors have NEVER been updated. The files which I wrote have been updated maybe once or twice in the past four months, but the errors have occurred both before and after the updates. One file threw an error for the first time this morning when including another file, and there are no functions in this file which accept any data as all the data needed is pulled from the database, so that one's really got me thrown for a loop. Any other ideas? Cheers and TIA, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php