Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.