mynamesleo Posted January 14, 2007 Share Posted January 14, 2007 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 >:( Quote Link to comment https://forums.phpfreaks.com/topic/34117-weird-problem/ Share on other sites More sharing options...
trq Posted January 14, 2007 Share Posted January 14, 2007 What are you trying to do? My guess is your running out of memory or something... your reaading the same page into an array over and over and over.... why? Quote Link to comment https://forums.phpfreaks.com/topic/34117-weird-problem/#findComment-160469 Share on other sites More sharing options...
mynamesleo Posted January 14, 2007 Author Share Posted January 14, 2007 Just used that as an example, the number it loops to will be much more and the page it reads will be differernt each time. Is that causing it to run out of memory? if so, what do i have to do? create a new variable for each page i read or?? Quote Link to comment https://forums.phpfreaks.com/topic/34117-weird-problem/#findComment-160480 Share on other sites More sharing options...
trq Posted January 14, 2007 Share Posted January 14, 2007 Im not sure if it would be running out of memory (ive never heard of that before), it just seems your storing allot of data.What are you trying to do? There might be a better way. Quote Link to comment https://forums.phpfreaks.com/topic/34117-weird-problem/#findComment-160481 Share on other sites More sharing options...
ShogunWarrior Posted January 14, 2007 Share Posted January 14, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/34117-weird-problem/#findComment-160487 Share on other sites More sharing options...
mynamesleo Posted January 14, 2007 Author Share Posted January 14, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/34117-weird-problem/#findComment-160493 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.