469,142 Members | 1,138 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,142 developers. It's quick & easy.

php_network_getaddresses: getaddrinfo failed

Hy,
i have a problem with PHP 5.1.6

I have a script containing something like this:
$f=fsockopen("www.site01.com",80,$errNo,$errStr);
var_dump($f);

When accessing this from apache, i get this error:
php_network_getaddresses: getaddrinfo failed.
When running the same scipt from the CLI (php ./dns.php), i get no
error, and i`m able to connect (and read/write) to www.site01.com

I have another script containing something like this:
$f=fsockopen("www.site02.com",80,$errNo,$errStr);
var_dump($f);

This site is available both from apache, and from CLI.

( so i`m able to connect only to certain websites)

This problem appeared about 1 month ago when the dns servers failed to
work, and they were changed(in /etc/resolv.conf). Before this was
done, everything worked fine. The thing i do not understand is why
only certain sites are available from php, but no restrictions apply
when in CLI.

Anybody else had this problem?

Dec 4 '07 #1
5 20578
On Tue, 04 Dec 2007 14:30:37 +0100, _q_u_a_m_i_s's <qu****@gmail.com
wrote:
Hy,
i have a problem with PHP 5.1.6

I have a script containing something like this:
$f=fsockopen("www.site01.com",80,$errNo,$errStr);
var_dump($f);

When accessing this from apache, i get this error:
php_network_getaddresses: getaddrinfo failed.
When running the same scipt from the CLI (php ./dns.php), i get no
error, and i`m able to connect (and read/write) to www.site01.com

I have another script containing something like this:
$f=fsockopen("www.site02.com",80,$errNo,$errStr);
var_dump($f);

This site is available both from apache, and from CLI.

( so i`m able to connect only to certain websites)

This problem appeared about 1 month ago when the dns servers failed to
work, and they were changed(in /etc/resolv.conf). Before this was
done, everything worked fine. The thing i do not understand is why
only certain sites are available from php, but no restrictions apply
when in CLI.
According to some old bugreports, on a DNS servers change (or new DHCP
lease?), the 'running' PHP module doesn't get the new DNS server address,
or at least bugs, while the CLI does get the change. What happens when you
restart apache/the webserver?
--
Rik Wasmus
Dec 4 '07 #2
On Dec 4, 3:41 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
On Tue, 04 Dec 2007 14:30:37 +0100, _q_u_a_m_i_s's <qua...@gmail.com>
wrote:
Hy,
i have a problem with PHP 5.1.6
I have a script containing something like this:
$f=fsockopen("www.site01.com",80,$errNo,$errStr);
var_dump($f);
When accessing this from apache, i get this error:
php_network_getaddresses: getaddrinfo failed.
When running the same scipt from the CLI (php ./dns.php), i get no
error, and i`m able to connect (and read/write) towww.site01.com
I have another script containing something like this:
$f=fsockopen("www.site02.com",80,$errNo,$errStr);
var_dump($f);
This site is available both from apache, and from CLI.
( so i`m able to connect only to certain websites)
This problem appeared about 1 month ago when the dns servers failed to
work, and they were changed(in /etc/resolv.conf). Before this was
done, everything worked fine. The thing i do not understand is why
only certain sites are available from php, but no restrictions apply
when in CLI.

According to some old bugreports, on a DNS servers change (or new DHCP
lease?), the 'running' PHP module doesn't get the new DNS server address,
or at least bugs, while the CLI does get the change. What happens when you
restart apache/the webserver?
--
Rik Wasmus
The apache server was restarted many times...still nothing.
Dec 4 '07 #3
_q_u_a_m_i_s's wrote:
On Dec 4, 3:41 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
>On Tue, 04 Dec 2007 14:30:37 +0100, _q_u_a_m_i_s's <qua...@gmail.com>
wrote:
>>Hy,
i have a problem with PHP 5.1.6
I have a script containing something like this:
$f=fsockopen("www.site01.com",80,$errNo,$errStr);
var_dump($f);
When accessing this from apache, i get this error:
php_network_getaddresses: getaddrinfo failed.
When running the same scipt from the CLI (php ./dns.php), i get no
error, and i`m able to connect (and read/write) towww.site01.com
I have another script containing something like this:
$f=fsockopen("www.site02.com",80,$errNo,$errStr);
var_dump($f);
This site is available both from apache, and from CLI.
( so i`m able to connect only to certain websites)
This problem appeared about 1 month ago when the dns servers failed to
work, and they were changed(in /etc/resolv.conf). Before this was
done, everything worked fine. The thing i do not understand is why
only certain sites are available from php, but no restrictions apply
when in CLI.
According to some old bugreports, on a DNS servers change (or new DHCP
lease?), the 'running' PHP module doesn't get the new DNS server address,
or at least bugs, while the CLI does get the change. What happens when you
restart apache/the webserver?
--
Rik Wasmus

The apache server was restarted many times...still nothing.
Was it completely stopped and started, or just restarted? The latter
only reloads the configuration, IIRC.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Dec 4 '07 #4
On Dec 4, 4:02 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
_q_u_a_m_i_s's wrote:
On Dec 4, 3:41 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
On Tue, 04 Dec 2007 14:30:37 +0100, _q_u_a_m_i_s's <qua...@gmail.com>
wrote:
>Hy,
i have a problem with PHP 5.1.6
I have a script containing something like this:
$f=fsockopen("www.site01.com",80,$errNo,$errStr);
var_dump($f);
When accessing this from apache, i get this error:
php_network_getaddresses: getaddrinfo failed.
When running the same scipt from the CLI (php ./dns.php), i get no
error, and i`m able to connect (and read/write) towww.site01.com
I have another script containing something like this:
$f=fsockopen("www.site02.com",80,$errNo,$errStr);
var_dump($f);
This site is available both from apache, and from CLI.
( so i`m able to connect only to certain websites)
This problem appeared about 1 month ago when the dns servers failed to
work, and they were changed(in /etc/resolv.conf). Before this was
done, everything worked fine. The thing i do not understand is why
only certain sites are available from php, but no restrictions apply
when in CLI.
According to some old bugreports, on a DNS servers change (or new DHCP
lease?), the 'running' PHP module doesn't get the new DNS server address,
or at least bugs, while the CLI does get the change. What happens when you
restart apache/the webserver?
--
Rik Wasmus
The apache server was restarted many times...still nothing.

Was it completely stopped and started, or just restarted? The latter
only reloads the configuration, IIRC.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
That fixed it:)
I restarted the whole server...after stopping apache it refused to
open again, so i restarted the server and it worked.

Thanx
Dec 4 '07 #5
On Dec 4, 9:54 am, "_q_u_a_m_i_s's" <qua...@gmail.comwrote:
On Dec 4, 4:02 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
_q_u_a_m_i_s's wrote:
On Dec 4, 3:41 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
>On Tue, 04 Dec 2007 14:30:37 +0100, _q_u_a_m_i_s's <qua...@gmail.com>
>wrote:
>>Hy,
>>i have a problem with PHP 5.1.6
>>I have a script containing something like this:
>> $f=fsockopen("www.site01.com",80,$errNo,$errStr);
>> var_dump($f);
>>When accessing this from apache, i get this error:
>>php_network_getaddresses: getaddrinfo failed.
>>When running the same scipt from the CLI (php ./dns.php), i get no
>>error, and i`m able to connect (and read/write) towww.site01.com
>>I have another script containing something like this:
>> $f=fsockopen("www.site02.com",80,$errNo,$errStr);
>> var_dump($f);
>>This site is available both from apache, and from CLI.
>>( so i`m able to connect only to certain websites)
>>This problem appeared about 1 month ago when the dns servers failed to
>>work, and they were changed(in /etc/resolv.conf). Before this was
>>done, everything worked fine. The thing i do not understand is why
>>only certain sites are available from php, but no restrictions apply
>>when in CLI.
>According to some old bugreports, on a DNS servers change (or new DHCP
>lease?), the 'running' PHP module doesn't get the new DNS server address,
>or at least bugs, while the CLI does get the change. What happens when you
>restart apache/the webserver?
>--
>Rik Wasmus
The apache server was restarted many times...still nothing.
Was it completely stopped and started, or just restarted? The latter
only reloads the configuration, IIRC.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

That fixed it:)
I restarted the whole server...after stopping apache it refused to
open again, so i restarted the server and it worked.

Thanx
Could it be an extension to php. some setups have multiple php.ini
files (for apache, cli, etc...) Try hunting around.
Dec 9 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Steve | last post: by
reply views Thread by StevePBurgess | last post: by
4 posts views Thread by edcdave | last post: by
reply views Thread by cole007 | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.