Same Code different Results!

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
cloudbase
Forum Newbie
Posts: 15
Joined: Tue Dec 13, 2011 12:11 pm

Same Code different Results!

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Same Code different Results!

Post by requinix »

What if you run the script manually?
cloudbase
Forum Newbie
Posts: 15
Joined: Tue Dec 13, 2011 12:11 pm

Re: Same Code different Results!

Post 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?
Post Reply