Class 'DOMDocument' not found

后端 未结 16 1427
余生分开走
余生分开走 2020-11-30 18:58

I\'ve found an error on a page in my Magento application; it always show this message error when I visit it:

Fatal error: Class \'DOMDocument\' not fo

相关标签:
16条回答
  • 2020-11-30 19:37

    Create an empty PHP file and put only <?php phpinfo(); in it, look at it in a browser.
    Check if you can spot --disable-dom in the configuration options and/or if you can see details about the DOM extension in the list below.

    If you cannot see DOM in the list or you see it is disabled, your PHP installation does not include the DOM extension. You'll need to recompile your PHP installation from source to remedy that.

    0 讨论(0)
  • 2020-11-30 19:37

    For PHP 7.4 Install the DOM extension.

    Debian / Ubuntu:

    sudo apt-get update
    sudo apt-get install php7.4-xml
    sudo service apache2 restart
    

    Centos / Fedora / Red Hat:

    yum update
    yum install php74w-xml
    systemctl restart httpd
    

    For previous PHP releases, replace with your version.

    0 讨论(0)
  • 2020-11-30 19:37

    PHP 7.X Centos 7

    I got dependency issues when trying to install module with above suggestions, adding this flag:

    --enablerepo=remi-php7X

    Resolved dependencies.

    So

    sudo yum --enablerepo=remi-php7X install php-xml

    Then

    service httpd restart

    Ref: Install PHP Modules

    0 讨论(0)
  • 2020-11-30 19:39

    PHP7: the latest version:

    sudo apt-get install php7.1-xml
    

    you can also do:

    sudo apt-get install php-dom
    

    and apt-get will show you where it is

    0 讨论(0)
  • 2020-11-30 19:39

    I'm using Centos and the followings worked for me , I run this command

    yum --enablerepo remi install php-xml
    

    And restarted the Apache with this command

    sudo service httpd restart
    
    0 讨论(0)
  • 2020-11-30 19:45

    On fedora 26:

    dnf install php-dom
    

    Fixes it !

    0 讨论(0)
提交回复
热议问题