the scripts restarts itself?
Posted: Wed Jul 21, 2010 8:01 am
I have a problem with a script that restarts itself after about 5 minutes or about 1000 url's crawled. It basically crawls url's and collects information, and after a while it simply restarts the main script. I have no idea why it does this.
<?php
include 'down_parse.php';
include 'static/config.php';
include 'static/opendb.php';
$result2 = mysql_query("SELECT Application_XML_File_URL FROM padentries");
if (!$result2) { echo 'Could not run query: ' . mysql_error(); exit; }
while ($row = mysql_fetch_array($result2)) {
$nn++;
echo "$nn. <b>". $row["Application_XML_File_URL"] ."</b> - ";
psite($row["Application_XML_File_URL"]);
}
mysql_close($conn);
?>
As you can see the variable $nn autoincrements itself for each url crawled. But after a while the entire script refreshes itself, clears the results on the screen and $nn starts over from 1.
<?php
include 'down_parse.php';
include 'static/config.php';
include 'static/opendb.php';
$result2 = mysql_query("SELECT Application_XML_File_URL FROM padentries");
if (!$result2) { echo 'Could not run query: ' . mysql_error(); exit; }
while ($row = mysql_fetch_array($result2)) {
$nn++;
echo "$nn. <b>". $row["Application_XML_File_URL"] ."</b> - ";
psite($row["Application_XML_File_URL"]);
}
mysql_close($conn);
?>
As you can see the variable $nn autoincrements itself for each url crawled. But after a while the entire script refreshes itself, clears the results on the screen and $nn starts over from 1.