SupaMonkey Posted March 1, 2006 Share Posted March 1, 2006 So I have a script that goes to a page and rips it of all the numbers and then goes onto the next page, etc etc. Basically the script works 100% and I can do up to about 90 pages at a time; as soon as I try and do any more than that - I get an "Internal Server Error" after a while. I tried the whole ob_start / flush theory which is supposedly supposed to work and it hasnt. Any idea's? - PHP is installed as CGI - Running Apache - Script is run off a local webserver and connects to remote pageHere is my script:[code]$none_found = '';$found_num = '';$found_at = '';set_time_limit(9000);ob_start();for ($i = 1; $i <= 90; $i++){ $fh = fopen("http://www.someplace.com/index.php?id=". $i,'r'); $result = ''; while(!feof($fh)) $result .= fgets($fh); fclose($fh); $message = strip_tags($result); if (preg_match("|\d{3} \d{3} \d{4}|", $message, $numbers_found)) { $found_at .= $i .","; $found_num .= $numbers_found[0] .'<br>'; mysql_query('insert into zzz_numbers (cellphone) values (\''. $numbers_found[0] .'\')'); } else $none_found .= $i .','; if (substr($i,strlen($i)-1) == '0') { echo "."; flush(); ob_flush(); } sleep(1);}echo "<br><br>None found at:<br>". $none_found;echo "<br><br>Found at:<br>". $found_at;echo "<br><br>Numbers found :<br>". $found_num;[/code] Quote Link to comment https://forums.phpfreaks.com/topic/3808-internal-server-error-script-timeout/ 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.