我有一个错误
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity
我在同一台服务器上有两个 php 文件,我想从生成 xml 的 php 接收 http 响应
更新.php
<?php
$url = '[pathtofile]response.php';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
/* Get the HTML or whatever is linked in $url. */
$response = curl_exec($ch);
$xml = simplexml_load_file($response);
curl_close($ch);
?>
和 response.php
<?php
header("Content-type: text/xml");
echo "<?xml version='1.0' encoding='ISO-8859-1'?>";
echo "<note>";
echo "<from>Jani</from>";
echo "<to>Tove</to>";
echo "<message>Remember me this weekend</message>";
echo "</note>";
?>
是什么导致错误?