dylanm Posted November 28, 2011 Share Posted November 28, 2011 Hello all, I am trying to read a remote xml file on a file server which requires username and password. I can access the xml file fine through HTTP authentication like \\111.11.11.111\\pdrs\fileserver\FullText\12345\12345_CLEANUP.xml But when i try to read it with PHP, I recieved a warning message: "Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity" allow_url_fopen is ON This is part of my code. $test=rawurldecode("http://username:password@\\\\111.11.11.111\\pdrs\\fileserver\\" . $number . "\\FullText\\" . $number . "_CLEANUP.xml"); echo $test; $xml_filename = simplexml_load_file(rawurldecode("($test)")); echo $xml_filename; print_r($xml_filename); Am I missing something here? Is there any other way to read/save/load a remote xml file which requires authentications? I am new to php so any help is appreciated! Thanks, Link to comment https://forums.phpfreaks.com/topic/251978-need-help-with-loadingreading-remote-xml-with-authentication/ Share on other sites More sharing options...
requinix Posted November 28, 2011 Share Posted November 28, 2011 I don't understand what you were thinking with the $test but try $xml_filename = simplexml_load_file("http://username:[email protected]/pdrs/fileserver/$number/FullText/$number_CLEANUP.xml"); Link to comment https://forums.phpfreaks.com/topic/251978-need-help-with-loadingreading-remote-xml-with-authentication/#findComment-1291930 Share on other sites More sharing options...
dylanm Posted November 29, 2011 Author Share Posted November 29, 2011 I tried that because the url was encoded and the '\' became '%5C%5C' Link to comment https://forums.phpfreaks.com/topic/251978-need-help-with-loadingreading-remote-xml-with-authentication/#findComment-1292314 Share on other sites More sharing options...
xyph Posted November 29, 2011 Share Posted November 29, 2011 \\10.0.0.1 is a Windows file sharing/networking protocol http://10.0.0.1 is the HTTP protocol. I'm not sure if you can use both. Link to comment https://forums.phpfreaks.com/topic/251978-need-help-with-loadingreading-remote-xml-with-authentication/#findComment-1292330 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.