您好请任何人都可以帮我解决这个问题,升级apache php后发生此错误
第6行第16行的PHP XML错误:xmlParsePI:无目标名称,
Fyi,我用的是sitemap.php页面,然后设置RewriteRule ^ sitemap.xml?$ sitemap.php。 以下是我的sitemap.php代码
header("Content-Type: text/xml;charset=iso-8859-1");
echo '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
include "config.php";
include "dbclass.php";
include "classes.php";
include "fgeneral.php";
$mydb = new myDBC();
//HOME
$result = $mydb->runQuery("SELECT * FROM `homepage`");
$row = $mydb->runFetchArray($result);
$date = $row["date"]; //the date stored
$year = substr($date,0,4); //work out the year
$mon = substr($date,5,2); //work out the month
$day = substr($date,8,2); //work out the day
$displaydate = ''.$year.'-'.$mon.'-'.$day.'';
?>
<url>
<loc><?=ROOT_URL?></loc>
<lastmod><?=$displaydate?></lastmod>
<changefreq>weekly</changefreq>
<priority>1.00</priority>
</url>
答案 0 :(得分:0)