delickate Posted September 27, 2011 Share Posted September 27, 2011 Hi, I'm trying to get weather from google. it is working fine on my local machine. but when i make the page live it starts giving error as follow: Warning: simplexml_load_file(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /vhost/vhost10/d/x/b/dxbconnect.com/www/demo/weather.php on line 9 Warning: simplexml_load_file(http://www.google.com/ig/api?weather=dubai): failed to open stream: no suitable wrapper could be found in /vhost/vhost10/d/x/b/dxbconnect.com/www/demo/weather.php on line 9 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://www.google.com/ig/api?weather=dubai" in /vhost/vhost10/d/x/b/dxbconnect.com/www/demo/weather.php on line 9 Fatal error: Call to a member function xpath() on a non-object in /vhost/vhost10/d/x/b/dxbconnect.com/www/demo/weather.php on line 10 can anyone help please? Quote Link to comment https://forums.phpfreaks.com/topic/247945-error-getting-weather/ Share on other sites More sharing options...
ManiacDan Posted September 27, 2011 Share Posted September 27, 2011 Well...like it says in the error message, allow_url_fopen is disabled in your configuration. You need to enable it. Go find php.ini, open it, find allow_url_fopen, and change it from a 0 to a 1. Then restart your server. If you're on a shared host, you can attempt to reset it manually, or use file_get_contents or curl to pull down the file you want, then load it into SimpleXML using another function. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/247945-error-getting-weather/#findComment-1273227 Share on other sites More sharing options...
delickate Posted September 27, 2011 Author Share Posted September 27, 2011 Thanks for the reply, I've tried it. but no luck. so please suggest some other. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/247945-error-getting-weather/#findComment-1273229 Share on other sites More sharing options...
ManiacDan Posted September 27, 2011 Share Posted September 27, 2011 What have you tried? You did exactly what I said and it still doesn't work? What's the new error message? Quote Link to comment https://forums.phpfreaks.com/topic/247945-error-getting-weather/#findComment-1273291 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.