Edit report at http://bugs.php.net/bug.php?id=43098&edit=1
ID: 43098
Comment by:
Reported by: harvie at email dot cz
Summary: file_get_contents() freezes (probably caused by
fopen())
Status: Open
Type: Feature/Change Request
Package: Feature/Change Request
Operating System: Linux (Debian Etch) - php5-cli
PHP Version: 5.2.4
New Comment:
So, has anyone found a way out of this problem?
Is it a known bug?
Previous Comments:
------------------------------------------------------------------------
[2007-10-26 10:49:02] harvie at email dot cz
Yeah! Thats what i need... Something like default_poll_timeout
setting...
------------------------------------------------------------------------
[2007-10-26 10:40:18] harvie at email dot cz
[email protected]: That is what i am saying, this will never comes to next
iteration. If i wan't to do some kind of error check, it will never be
executed, because whole program will stop at file_get_contents() and
will not execute anything after this call. Thats the problem. This
function will never return anything.
With this timeout, this script have to print '#' at least once a
second.
But the default_socket_timeout stops waiting for connection but in this
case the file_gets_contents() is already downloading when server drops
the connection because of network unstability or service overload.
Isn't there some kind of timeout, that will stop waiting for broken
connection after specified time?
------------------------------------------------------------------------
[2007-10-26 08:16:58] [email protected]
It won't matter what you put in timeout if you wrap everything in a
while(1) loop. Of course it just sits there, try adding some error
checking there..
------------------------------------------------------------------------
[2007-10-25 17:21:10] harvie at email dot cz
[email protected]: It's possible, but in this case the
default_socket_timeout have to close the socket and continue with next
URL (crawler freezing too with many different URLs). Or
default_socket_timeout doesn't matter in here?
It's true, that my router sux, but i don't see any reason why PHP should
crash at first problem with connectivity, that ends in total script
freeze, i thought, that is why we have socket timeout option. Or not?
------------------------------------------------------------------------
[2007-10-25 11:57:20] [email protected]
Are you sure it's not just your network connection freezing? f.e. some
kind of firewall stopping you from connecting to one site too many times
in too short time? (fyi: your script works fine for me, I stopped it
after 10 minutes..)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=43098
--
Edit this bug report at http://bugs.php.net/bug.php?id=43098&edit=1