I'm having problems loading XML data from remote server. I don't think I can give away the exact XML url, because of the paperwork behind it, but suffice it to know that all this code works PERFECTLY on my workstation's development environment (Win 2k, Apache 1.3.x, PHP 5.1.2). I just can't get it to work on the live server (CentOS Linux, Apache 2.x, PHP 5.1.2)
$importantNumber = '12345'; $action = 'http://foo.com/' . $importantNumber . '/file.xml';, $xml = simplexml_load_file( $action );
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: simplexml_load_file(http://foo.com/12345/file.xml) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /var/www/project/compare.inc on line 122
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http%3A//foo.com/12345/file.xml" in /var/www/project/compare.inc on line 122[/quote]
In summary, the URL gets esccaped as 'http%3A//...', which results in the 400 error.
And, yes, allow_url_fopen = On, and yes, I RTFM already
Any one encounter this before?