On Wed, Jun 19, 2013 at 1:07 AM, Chun-Ta Kung <[email protected]> wrote:
> Even I use the simplest code, I will get the same error.
> <?php
> file_get_contents('http://www.google.com');
> ?>
>
> Any idea?
>
>
Hello Chun-Ta,
+1 on Amy's suggestion, that your local computer is most likely having
difficulties with DNS resolving.
You can double check if this is the problem by trying to send http requests
directly to IP addresses. For example, instead of attempting to access
http://google.com, try accessing http://74.125.227.192 (this IP address is
listed as one of the A records for google.com, you can double check this by
looking up the DNS information for Google).
If the direct query to the IP address works, then your computer is failing
to resolve DNS properly. If this still fails, you may have a more complex
issue.
-----------------
-Vinny P
Technology & Media Advisor
Chicago, IL
App Engine Code Samples: http://www.learntogoogleit.com
On Wed, Jun 19, 2013 at 7:53 PM, Amy Unruh <[email protected]> wrote:
> It sounds like your computer might be having trouble resolving hostnames--
> have you noticed any other indications of that?
>
> On 19 June 2013 16:07, Chun-Ta Kung <[email protected]> wrote:
>
>> Hi,
>>
>> I tested the sample code on this page: https://developers.
>> google.com/appengine/docs/php/urlfetch/
>>
>> the script is like this:
>>
>> $data = array('data' => 'this', 'data2' => 'that');
>> $data = http_build_query($data);
>> $context =
>> array("http"=>
>> array(
>> "method" => "get",
>> "header" => "custom-header: custom-value\r\n" .
>> "custom-header-two: custome-value-2\r\n" ,
>> "content" => $data
>> )
>> );
>> $context = stream_context_create($context);
>> $result = file_get_contents("http://app.com/path?query=update", false,
>> $context);
>>
>>
>> However, I always get an error from server like below:
>>
>> *Warning*: file_get_contents(): php_network_getaddresses: getaddrinfo
>> failed: A non-recoverable error occurred during a database lookup. in *
>> C:\gae_work\helloworld\helloworld.php* on line *14*
>>
>> *Warning*: file_get_contents(http://app.com/path?query=update): failed
>> to open stream: php_network_getaddresses: getaddrinfo failed: A
>> non-recoverable error occurred during a database lookup. in *
>> C:\gae_work\helloworld\helloworld.php* on line *14*
>>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.