Search code examples
phpsimplexml

simplexml_load_file() error


I'm relatively new with PHP and more so with XML.

I have a script working perfectly on my localhost, but when I try and put it on my Server, I get this message:

Warning: simplexml_load_file() [function.simplexml-load-file]: http://api.wefeelfine.org:8080/ShowFeelings?display=xml&feeling=happy&returnfields=imageid,feeling,sentence,posttime,postdate,posturl,gender,country,state,city,lat,lon&limit=0&extraimages=20:1:

parser error : Document is empty in /home2/alsweet/public_html/notalone.php on line 21

The line of code which is not working is this:

// get api feed
$xml = simplexml_load_file('http://api.wefeelfine.org:8080/ShowFeelings?display=xml&feeling=' . $feeling . '&returnfields=imageid,feeling,sentence,posttime,postdate,posturl,gender,country,state,city,lat,lon&limit=0&extraimages=20');

Have I made a mistake? Should I be speaking to my hosting provider?


Solution

  • this was infact a problem with my hosting,

    it turns out it was becuase i was trying to call out to another server on port 8080 which was not open outbound in the firewall. so they opened it and it works fine.

    thanks a lot for the help!