PHP Classes

Could not resolve host

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Could not resolve host  >  (Un) Subscribe thread alerts  
Subject:Could not resolve host
Summary:Is there an easy way to remove the reliance on the http class
Messages:2
Author:Nigel Johnson
Date:2014-01-11 12:40:42
Update:2014-01-11 21:57:09
 

  1. Could not resolve host   Reply   Report abuse  
Picture of Nigel Johnson Nigel Johnson - 2014-01-11 12:40:42
I have spent a few hours implementing this class as it's something I really need. I got it working on my dev platform on my laptop but when I pushed it up to my production platform (Google Apps Engine) it no longer works because the http class can't resolve hostnames.

This is not a problem with the platform. I copied the test_http_image_request.php (with a new url) and it fails on GAE, yet if i use this:

<?php
$url="http://files.phpclasses.org/graphics/phpclasses/logo-phpclasses.png";
$c = file_get_contents($url);
echo "<p>Got ".strlen($c)." bytes from $url</p>";
?>

which is essentially what I'm testing with the http class, I get the 8440 bytes both on my dev platform and production.

Any help very much appreciated.

  2. Re: Could not resolve host   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-01-11 21:57:09 - In reply to message 1 from Nigel Johnson
Yes, Google App Engine does not support socket connections, as explained by this article. The solution would be to work with a different HTTP client that works with file functions. This will take time but can be done.

phpclasses.org/blog/post/208-5-Reas ...