Re: Re: fopen() for http:// sometimes working, sometimes not

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If it's a busy server, you may be running out of TCP connections...

If PHP can't open ANY connection at all, it can't do a DNS lookup, and
it would fail very fast, as it's hitting an OS limit/cap on the number
of connections and not even getting to try to talk to the Internet.

On Fri, December 28, 2007 12:03 pm, Albert Wiersch wrote:
> I'm now using PHP 5.2.5.
>
> Well, it seems to still be happening. This describes the problem but I
> haven't found a solution that works for me yet:
> http://bugs.php.net/bug.php?id=11058
>
> Is it a PHP problem or DNS? It works sometimes but not other
> times......
> something strange is going on.
>
> Example messages:
> [Fri Dec 28 11:59:04 2007] [error] [client 192.168.0.51] PHP Warning:
> fopen() [<a href='function.fopen'>function.fopen</a>]:
> php_network_getaddresses: getaddrinfo failed: Name or service not
> known
> [Fri Dec 28 11:59:04 2007] [error] [client 192.168.0.51] PHP Warning:
> fopen(http://www.lantanalinks.com) [<a
> href='function.fopen'>function.fopen</a>]: failed to open stream:
> Success
>
> I suppose I could adjust the script to try again if it fails the first
> time,
> but I shouldn't have to.
>
> Some additional info, when it fails with this problem, it fails very
> quickly
> (in less than half a second)... its like it doesn't even try to look
> up the
> name.
>
> --
> Albert Wiersch
> Fix your website: http://onlinewebcheck.com
>
>
> ""Albert Wiersch"" <support@xxxxxxxxxxxxxxxxx> wrote in message
> news:D5.5A.52211.973D3774@xxxxxxxxxxxxxxx
>>
>> I noticed my script at http://onlinewebcheck.com was sometimes
>> (fairly
>> often) failing to open some URLs that users have entered. fopen()
>> returns
>> false very quickly, but when tried again with the same URL,
>> sometimes it
>> works. What would cause this behavior? Why does fopen() occasionally
>> fail
>> to open valid http addresses but works at other times?
>>
>> --
>> Albert Wiersch
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux