file_get_html() not working in Google App Engine

I have some PHP code working perfectly in local and also in the web (with a non SSL hosting). I get file contents with file_get_html(url) and everything works OK.

The problem comes when I try to run this code in Google App Engine. The function file_get_html() doesn’t work.

The following code shows nothing between BEGIN and END:

header("Access-Control-Allow-Origin: *");

include './simple_html_dom.php';

$sitioweb = file_get_html("");

echo "BEGIN<hr>";
echo $sitioweb;
echo "<hr>END";

Any help will be appreciated!

Finally I found the solution. I use curl instead file_get_html.

Code that doesn’t work for me in Google App Engine:

$sitioweb = file_get_html("");

Code that work perfectly for me in Google App Engine:

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, '');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
$str = curl_exec($curl);

$sitioweb = str_get_html($str);

It is a bit more verbose but works šŸ™‚