473,542 Members | 9,296 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 20968
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5155
by: Steve | last post by:
Visitors to my site have been getting a random error. It's been happening more and more frequently lately. ______________________________ Warning: Unknown(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/httpd/vhosts/domain.com/file1.php(394) : eval()'d code on line 16 ______________________________
0
4953
by: Matt | last post by:
I'm trying to get the HTML data off of a webpage. Let's say for the sake of argument it's the python homepage. I've googled around and found some examples that people said worked. Here's what I've cobbled together: #getHTML.py ############################################ import urllib import urllib2 proxy_info = {'user':'us3r',
0
1827
by: StevePBurgess | last post by:
Hi - I am using this url_exists function: to check whether files exist on other peoples webservers (before allowing my users to add the site to their directory of rss feeds). On my current shared hosting (running Apache 1.3.29 Red Hat Linux PHP 4.3.10) the function works perfectly. On my new, Plesk VPS system (running Apache 2.0.51 Fedora PHP...
4
2189
by: edcdave | last post by:
I'm trying to get MoinMoin 1.5.4 running with Python 2.3.4 (installed from an SCO Skunkworks binary). Python 2.3.4 (#1, Aug 27 2004, 18:22:39) on sco_sv3 One of the MoinMoin modules attempts to import cgi and triggers this traceback: Traceback (most recent call last): File "./moin.cgi", line 43, in ? from MoinMoin.request import...
1
23736
by: Henry16 | last post by:
Never seen such a situation ! Do you have once faced this problem ? We use a fsockopen to retrieve a content from a URL . The content is dispalid corretly on a page on one of our servers. But on an other server (more-or-less same config.) the content is not displaid !! with the error message :: Warning: fsockopen():...
0
1627
by: cole007 | last post by:
Hi all, New to this forum so thought would start off with a query that has been causing me some problems. Trying to work with remote images using gd libraries and get the following message: Warning: getimagesize() : php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\Apache\Apache2\htdocs\map\image.php on line 4 Warning:...
2
4022
by: John Nagle | last post by:
Here's a strange little bug. "socket.getaddrinfo" blows up if given a bad domain name containing ".." in Unicode. The same string in ASCII produces the correct "gaierror" exception. Actually, this deserves a documentation mention. The "socket" module, given a Unicode string, calls the International Domain Name parser, "idna.py", which...
3
39967
by: sandipbhoi | last post by:
Hello all, I have implemented a integration of payment gateway with paypal. Currently my site is hosted at a shared server. The site under test was working properly till there was no change on hosting server. But now on hosting server (server admin) made some changes(update). and now i as getting the warning shown above ... What changes...
0
11340
by: jinsue | last post by:
Hi all, I am having trouble getting a client/server relationship to connect; receiving the above error. Python 2.6.5, Win7 On one end we have the socket being bound and that is all working with correct (IP) and as far as I know, correct socket settings. def listen_for_peer_setup(server_connection): listening_socket =...
0
7384
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5862
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4878
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3377
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1790
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.