警告:DOMDocument::load() [domdocument.load]:I/O 警告:无法加载外部实体
我在本地计算机上通过 XAMPP 运行的应用程序中使用了这段 php 脚本:
$dom = new DomDocument();
$filename = "library.xml";
if (!$dom->load($filename))
die("Could not parse iTunes XML file: ".$filename);
然后我尝试将此应用程序移动到 WampServer,但没有成功,并出现以下警告:
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
错误中的这一行正是加载行,其中在早期版本的 XAMPP 中可以完美运行,但现在不能在 XAMPP 1.7.7 上运行
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 this 为什么不尝试使用绝对路径作为文件路径。
我还看到这个 php 文件位于
C:\wamp\www\parser\includes\libs
,并且在C:/wamp/www/parser/< 中搜索library.xml /代码>。这是正确的吗?
也有可能您在之前的 xampp 安装中关闭了警告/错误。因此请检查这个< /a> 也。
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 atC:/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.