Jump to content

Weird problem


mynamesleo

Recommended Posts

Ok guys this is driving me cookooo now  :-\

Ok this works fine, echo's out up to 440.
[code]
for ($x=0;$x<441;$x++) 

{
    echo "Scanned " . $x . "<br>";
}
[/code]
 


But adding this new line in, it stops at 49. What the hell?
[code]
for ($x=0;$x<441;$x++) 

{
    [b]$chtml = strtolower(file_get_contents("http://yahoo.com"));[/b]
    echo "Scanned " . $x . "<br>";
}
[/code]



Sorry if this is something silly, i'm still new to php, I just dont understand how adding that line in causes it to stop looping at 49  >:(
Link to comment
https://forums.phpfreaks.com/topic/34117-weird-problem/
Share on other sites

It's almost definitely a memory/process problem.
Sometimes a connection can take over 3 seconds, making 441 connections is nuts!
Also, you could simply be crashing Apache with that many connections in a row or Yahoo may block you for repeated server-bashing.
Link to comment
https://forums.phpfreaks.com/topic/34117-weird-problem/#findComment-160487
Share on other sites

well, yahoo was an example website.... it seems to crash out on 49 on any website.

What I am doing is just basicly scanning the html of a bunch of sites, for certain information. Nothing "dodgy" mind. I can do it fine in visual basic but thought id try it out in php. Is there anything else i could try?
Link to comment
https://forums.phpfreaks.com/topic/34117-weird-problem/#findComment-160493
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.