Can't Consume Web Services
I've been trying to access Google Maps web services or even Yahoo Maps using PHP. When I run it, I get nothing. All the HTML and prints come out but absolutely nothing from Google service.
开发者_开发知识库When I gave the code to my friend to run it on his local PC, it showed up fine and was working showing the map. But it seems I have trouble here at university.
Is it because I am behind a proxy? What could be the issue? Also the host can't be accessed outside the university.
Is there any solution to this?
If it is getting stuck on simplexml_load_file
, and you are trying to use simplexml_load_file
to get a remote file, and your University (like mine) has PHP in safe mode, this will fail. You can't get remote files like that in safe-mode. You should get the XML via cURL
, and then use simplexml_load_string
.
This would also explain why your friend could do it and you couldn't.
精彩评论