$xml = new DomDocument('1.0');提示 Class 'DomDocument' not found 怎么处理?

解决方案 »

  1.   

    本帖最后由 xuzuning 于 2010-08-27 16:51:22 编辑
      

  2.   

    我PHP版本是 Version 5.2.13
      

  3.   

    linux 系统?
    那可能没安装
    http://www.google.com.hk/search?q=Class+'DomDocument'+not+found&hl=zh-CN&newwindow=1&safe=strict&rls=com.microsoft:zh-cn:IE-SearchBox&rlz=1I7BJYT_zh-CN&source=lnt&tbs=lr:lang_1zh-CN&lr=lang_zh-CN&sa=X&ei=NYJ3TN6FCNivcPmJ-YQG&ved=0CAgQpwU
      

  4.   

    是linux,而且是centos 5.5的.呵
      

  5.   

    已经安照教的方法安装,但还是不成功。
    [root@alone ~]# yum install php-dom
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: centos.candishosting.com.cn
     * base: centos.ustc.edu.cn
     * extras: centos.candishosting.com.cn
     * updates: www.ftp.ne.jp
    Setting up Install Process
    Package php-xml-5.2.13-1.x86_64 already installed and latest version
    Nothing to do
    [root@alone ~]# service httpd restart
      

  6.   

    问题解决了,原因是php引用扩展库失败了。
    原来Kloxo装在64位的CentOS系统上,需要修改php扩展库的路径。/etc/php.ini中extension_dir = /usr/lib/php/modules 如果系统是32位,则会存在这个目录,如果64位就没有,但是位于/usr/lib64/php/modules ,但是如果仅仅修改extension_dir是不够的。
    第一种解决方法:直接重装为32位CentOS,再重新安装Kloxo。
    第二种方法:创建软连接,将/usr/lib/php/指向到/usr/lib64/php/
    执行: ln -s /usr/lib64/php/ /usr/lib
    重启Apache: /etc/rc.d/init.d/httpd restart
    再去检查一遍环境,现在显示都支持了。