Results 1 to 1 of 1
Hello,
I'm trying to use a very simple script that I've been using for a while now:
PHP Code:
Function GetLatLng_old ( $Address , $Type ){
$Request = ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-01-2008 #1Just Joined!
- Join Date
- Dec 2005
- Posts
- 9
failed to open stream: HTTP request failed??
Hello,
I'm trying to use a very simple script that I've been using for a while now:
as of the last few days this has stopped working and has started producing the following error:PHP Code:
Function GetLatLng_old($Address,$Type){
$Request = "http://maps.google.com/maps/geo?q=" . urlencode($Address) . "&output=xml&key=" . GOOGLE_MAP_KEY;
return str_replace("|","",trim($Request)); exit;
$page = file_get_contents($Request);
$xml = new SimpleXMLElement($page);
$Result = $xml->Response->Placemark->Point->coordinates;
$LatLng = explode(",",$Result);
if($Type == "Lng") return $LatLng[0];
if($Type == "Lat") return $LatLng[1];
}
[function.file-get-contents]:failed to open stream: HTTP request failed!
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML'
I'm getting this same error with all remote type functions like fopen and others.
I've searched google and found this:
"To resolve the problem, ensure that allow_url_fopen is enabled in PHP.INI configuration file. The line should look like this:
allow_url_fopen = On"
on allow of forums, however thats not the issue in my case as this is enabled.
I'm running PHP Version 5.1.2 on Ubuntu, any ideas on what the issue might be would really help.
thanks in advance for your time!
-Ken


Reply With Quote
