Chris! -
Joined: 08 Nov 2007 Posts: 5
|
Posted: Sun Dec 11, 2011 2:47 pm Post subject: message "Error 500 Internal Server Error" |
|
|
Hello
When I run the below displayed script, I get this message "Error 500 Internal Server Error" after having acquired around max 149 files.
I used this defense in December 2010 where it worked perfectly and I got about 2 x 5000 files.
Anyone have ideas about what is wrong?
I use:
Windows XP Pro with SP2.
Abyss Web Server X1 ver. 2.7
PHP 5.3.8. (from the Abyss)
MySql ver. 5.0.19
In php.ini:
"max_execution_time = 30", gives about 15 downloaded files
"max_execution_time = 300" gives about 149 downloaded files
"max_execution_time = 3000" provides approximately 149 downloaded files
"max_execution_time = 30000", gives about 149 downloaded files
This is my php script:
Code: |
<?PHP
/*
Flemming, d. 3. September 2010
*/
$opg = "B"; // R=Result og B=Balance
IF ($opg == "R")
{
$link_L = "http://moneycentral.msn.com/investor/invsub/results/statemnt.aspx?Symbol=";
$link_R = "&lstStatement=Income&stmtView=Qtr";
}
IF ($opg == "B")
{
$link_L = "http://moneycentral.msn.com/investor/invsub/results/statemnt.aspx?Symbol=";
$link_R = "&lstStatement=Balance&stmtView=Qtr";
}
@mysql_connect("localhost", "root", "") or die(mysql_error());
//@mysql_select_db("_invest") or die(mysql_error());
@mysql_select_db("finviz") or die(mysql_error());
$query = @mysql_query("SELECT * FROM ms_symbol");
$rows = @mysql_num_rows($query);
while($row = @mysql_fetch_assoc($query))
{
$symb = $row['symbol'];
echo $symb, "<br/>";
$link = $link_L.$symb.$link_R;
$h = implode("",file($link));
$filen = 'data/' . $opg . '_' . $symb;
$fil = fopen($filen, "w"); //Åben filen
fwrite($fil, $h);
fclose($fil); //Luk filen
}
echo "Antal record = ", $rows;
?>
|
|
|