Page 1 of 1

Same Code different Results!

Posted: Sun Mar 25, 2012 10:21 pm
by cloudbase
I apologize to begin with for not knowing where to post this question.

Apache version 1.3.42
PHP version 5.3.5
MySQL version 5.0.95-community
Architecture i686
Operating system linux

A cRon job calls a php file with the following function:

Code: Select all

//Get a defined list of images from $source_path - rename them and save to $local_path.
function GetUrlImage ($source_paths, $local_path) {
			ini_set('max_execution_time', 60);
			$i = -1;
			foreach ($source_paths as $path) {
				$i++;
				$c = 10;
				foreach ($path as $name) {
					$source_image = pathinfo ($name, PATHINFO_BASENAME);
					$file = $local_path[$i] . $c . ".gif";
					$c++;
					$source_file = file_get_contents ($name);
					file_put_contents ($file, $source_file);
				}
			}
		}
For 2 months this has been working as intended. Since this morning a random number (lets say 1-8) of the total 25 files is not making it. There is no order or sequence to the results.

ANY ideas ANYBODY please!

Thanks
Ron

Re: Same Code different Results!

Posted: Sun Mar 25, 2012 10:29 pm
by requinix
What if you run the script manually?

Re: Same Code different Results!

Posted: Mon Mar 26, 2012 10:42 am
by cloudbase
It runs under wamp from my laptop and using include() from the server. All the $source_paths manually entered are valid. My cRon job runs every three hours with error log recording errors since yesterday thru 6am today. The 9am run worked!
Is there any logic that would explain such erratic behavior?