473,800 Members | 2,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php_network_get addresses: getaddrinfo failed

Hy,
i have a problem with PHP 5.1.6

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

When accessing this from apache, i get this error:
php_network_get addresses: 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("w ww.site02.com", 80,$errNo,$errS tr);
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 20995
On Tue, 04 Dec 2007 14:30:37 +0100, _q_u_a_m_i_s's <qu****@gmail.c om
wrote:
Hy,
i have a problem with PHP 5.1.6

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

When accessing this from apache, i get this error:
php_network_get addresses: 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("w ww.site02.com", 80,$errNo,$errS tr);
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.comwro te:
On Tue, 04 Dec 2007 14:30:37 +0100, _q_u_a_m_i_s's <qua...@gmail.c om>
wrote:
Hy,
i have a problem with PHP 5.1.6
I have a script containing something like this:
$f=fsockopen("w ww.site01.com", 80,$errNo,$errS tr);
var_dump($f);
When accessing this from apache, i get this error:
php_network_get addresses: 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.co m
I have another script containing something like this:
$f=fsockopen("w ww.site02.com", 80,$errNo,$errS tr);
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.comwro te:
>On Tue, 04 Dec 2007 14:30:37 +0100, _q_u_a_m_i_s's <qua...@gmail.c om>
wrote:
>>Hy,
i have a problem with PHP 5.1.6
I have a script containing something like this:
$f=fsockopen("w ww.site01.com", 80,$errNo,$errS tr);
var_dump($f);
When accessing this from apache, i get this error:
php_network_g etaddresses: 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.co m
I have another script containing something like this:
$f=fsockopen("w ww.site02.com", 80,$errNo,$errS tr);
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*******@attgl obal.net
=============== ===

Dec 4 '07 #4
On Dec 4, 4:02 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
_q_u_a_m_i_s's wrote:
On Dec 4, 3:41 pm, "Rik Wasmus" <luiheidsgoe... @hotmail.comwro te:
On Tue, 04 Dec 2007 14:30:37 +0100, _q_u_a_m_i_s's <qua...@gmail.c om>
wrote:
>Hy,
i have a problem with PHP 5.1.6
I have a script containing something like this:
$f=fsockopen("w ww.site01.com", 80,$errNo,$errS tr);
var_dump($f);
When accessing this from apache, i get this error:
php_network_ge taddresses: 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.co m
I have another script containing something like this:
$f=fsockopen("w ww.site02.com", 80,$errNo,$errS tr);
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...@attgl obal.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.c omwrote:
On Dec 4, 4:02 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
_q_u_a_m_i_s's wrote:
On Dec 4, 3:41 pm, "Rik Wasmus" <luiheidsgoe... @hotmail.comwro te:
>On Tue, 04 Dec 2007 14:30:37 +0100, _q_u_a_m_i_s's <qua...@gmail.c om>
>wrote:
>>Hy,
>>i have a problem with PHP 5.1.6
>>I have a script containing something like this:
>> $f=fsockopen("w ww.site01.com", 80,$errNo,$errS tr);
>> var_dump($f);
>>When accessing this from apache, i get this error:
>>php_network_g etaddresses: 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.co m
>>I have another script containing something like this:
>> $f=fsockopen("w ww.site02.com", 80,$errNo,$errS tr);
>> 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...@attgl obal.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
5174
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
4980
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
1841
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.3.10) it doesn't work - I get this error: php_network_getaddresses: getaddrinfo failed If...
4
2201
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 RequestCGI
1
23772
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(): php_network_getaddresses: getaddrinfo failed:
0
1651
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: getimagesize(http://www.coflein.gov.uk/wales_thumbnails/CD2003_645_013.jpg) : failed to open...
2
4043
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 has a a whole error system of its own. The IDNA documentation says that "Furthermore, the socket...
3
40641
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 has been occurred in the environment for php i don't know but thank god i have noted some information...
0
11372
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 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) listening_socket.setsockopt(socket.SOL_SOCKET,...
0
10509
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10256
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10039
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9095
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6824
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4152
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
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2953
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.