plusnplus Posted June 16, 2010 Share Posted June 16, 2010 Hi.., I have code: <?php header("content-type: text/xml"); $xmlData = file_get_contents("http://www.google.com/ig/api?weather=new%20york"); echo $xmlData; ?> and get error:XML Parsing Error: no element found. is this kind of error need some setting in php.ini? or what i should look at phpinfo() to make sure the setting is ok. or.. is there any setting in apache? i'm using win XP, apache, php and mysql. if i type direct in browser: http://www.google.com/ig/api?weather=new%20york it give me the xml file withour any error. thanks for any reply/ help Quote Link to comment Share on other sites More sharing options...
Mchl Posted June 16, 2010 Share Posted June 16, 2010 Check what is the setting of allow_url_fopen in php.ini Quote Link to comment Share on other sites More sharing options...
plusnplus Posted June 16, 2010 Author Share Posted June 16, 2010 Check what is the setting of allow_url_fopen in php.ini i see in phpinfo() is "on" for local and master value.\ so should be OK? but still i can not get result from code i type. Quote Link to comment Share on other sites More sharing options...
plusnplus Posted June 17, 2010 Author Share Posted June 17, 2010 is this have related with php version? i using php 4.4.9 should i upgrade to php 5? Quote Link to comment Share on other sites More sharing options...
Mchl Posted June 17, 2010 Share Posted June 17, 2010 In general you should, because 4.x versions are no longer supported. In particular, this should not be the cause of this error. What does var_dump($xmlData); show? Do you have error_reporting enabled? Quote Link to comment 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.