Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity

谁说胖子不能爱 提交于 2019-12-24 11:56:54

问题


I was using this piece of php script in a application running under over XAMPP on my local machine:

$dom = new DomDocument();
$filename = "library.xml";

if (!$dom->load($filename))
    die("Could not parse iTunes XML file: ".$filename);

Then i tried to move this application to a WampServer without success, with the following warning:

Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity "file:///C:/wamp/www/parser/library.xml" in C:\wamp\www\parser\includes\libs\itunes_xml_parser.lib.php on line 111

This line in the error is exactly the load line, which worked flawlessly in earlier versions of XAMPP and isn't working now on XAMPP 1.7.7


回答1:


As per this why don't you try using an absolute path for your filepath.

Also i see that this php file is located at C:\wamp\www\parser\includes\libs and library.xml is being searched at C:/wamp/www/parser/. Is this correct?

It could also be possible that you had turned off warnings/errors in your earlier xampp installation.So check this also.



来源:https://stackoverflow.com/questions/9112482/warning-domdocumentload-domdocument-load-i-o-warning-failed-to-load-ex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!