unable to fetch content from a URL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jaini
Forum Newbie
Posts: 4
Joined: Wed Jan 23, 2008 8:35 am

unable to fetch content from a URL

Post by jaini »

i am trying to connect this URL to get latitude, longitude of a state
but its throwing warning can u pls tell me what would be the reason

"Warning: file_get_contents(http://maps.google.com/maps/geo?&q=Dist ... HqrFcWo5vA) [function.file-get-contents]: failed to open stream: Permission denied in GoogleMapAPI.class.php on line 1343"
User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

Re: unable to fetch content from a URL

Post by Chalks »

jaini wrote:i am trying to connect this URL to get latitude, longitude of a state
but its throwing warning can u pls tell me what would be the reason

"Warning: file_get_contents(http://maps.google.com/maps/geo?&q=Dist ... HqrFcWo5vA) [function.file-get-contents]: failed to open stream: Permission denied in GoogleMapAPI.class.php on line 1343"
I would venture to guess that Google doesn't like people to take their data without permission:

"Permission denied in GoogleMapAPI.class.php"
jaini
Forum Newbie
Posts: 4
Joined: Wed Jan 23, 2008 8:35 am

Re: unable to fetch content from a URL

Post by jaini »

i registered my site url with google and i got API key also. i implemented the same on windows and its working fine. on linux server i am getting warning
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: unable to fetch content from a URL

Post by Kieran Huggins »

they authenticate you by your url - make sure you have the domain / directory correct for your linux machine also.
jaini
Forum Newbie
Posts: 4
Joined: Wed Jan 23, 2008 8:35 am

Re: unable to fetch content from a URL

Post by jaini »

should i change any settings in httpd.conf? so that server can connetct a remote server and it can fetch data.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: unable to fetch content from a URL

Post by Christopher »

Can you use file_get_contents() for that? Maybe you need to use cURL.
(#10850)
jaini
Forum Newbie
Posts: 4
Joined: Wed Jan 23, 2008 8:35 am

Re: unable to fetch content from a URL

Post by jaini »

i tried with the all ways(file_get_contents, CURL, fsocket )
but getting same warning messge
Post Reply