我做了php 读写xml程序,在单机上能用,为什么到了服务器上会有这个错误,百思不的其解?
Fatal error: Class 'DOMDocument' not found in /var/www/html/home/chat.php on line 222
////////////////////////程序段:
$doc=new DOMDocument('1.0');
@$doc->load("../home/data.xml");
$data=$doc->getElementsByTagName("data")->item(0);//
$item=$doc->createElement('item');
$username=$doc->createElement("username",utf8_encode($nick));
$item->appendChild($username);
$content = $doc->createElement("content",utf8_encode($msg));
$item->appendChild($content);
$data->appendChild($item);
$doc->save('data.xml');
Fatal error: Class 'DOMDocument' not found in /var/www/html/home/chat.php on line 222
////////////////////////程序段:
$doc=new DOMDocument('1.0');
@$doc->load("../home/data.xml");
$data=$doc->getElementsByTagName("data")->item(0);//
$item=$doc->createElement('item');
$username=$doc->createElement("username",utf8_encode($nick));
$item->appendChild($username);
$content = $doc->createElement("content",utf8_encode($msg));
$item->appendChild($content);
$data->appendChild($item);
$doc->save('data.xml');
用function_exist函数查一下看看。
或将get_defined_functions()打出来看看有没DomDocument的函数
用function_exist函数查一下看看。
或将get_defined_functions()打出来看看有没DomDocument的函数
这位大哥:我的单机也查不出有DomDocument()!!
class_exists()和 get_declared_interfaces()这2个函数。