簡體   English   中英

在 Drupal 8 站點中找不到類“DOMDocument”

[英]class “DOMDocument” not found in a Drupal 8 site

我在我的 Drupal 8 站點的一個頁面上發現了一個錯誤; 當我訪問它時,它總是顯示此消息錯誤:

Error: Class 'DOMDocument' not found in /var/www/vhosts/mysite/core/lib/Drupal/Component/Utility/Html.php on line 286

我正在使用 Centos 6 並運行以下命令:

    yum install php71w-xml
    sudo service httpd restart 

我在 php.ini 中驗證:擴展 php 已啟用 dom、xml、xmlreader、xmlwrite 但對我不起作用。

你能給我一個解決方案嗎? 我是 Drupal 8、php 7.1、apache2.2

我在使用 php 7.x 的 Ubuntu 上遇到了同樣的問題,並通過以下操作修復了它。

sudo apt-get install php-xml

完成后,重新啟動您的網絡服務器

來源:https://laracasts.com/discuss/channels/servers/how-do-i-install-the-dom-extension-for-php7

您需要安裝 XML 擴展

$ sudo apt-get update 
$ sudo apt-get install php5.6-xml //for PHP 5.6

然后重啟apache

$ sudo service apache2 restart

如果使用 NGINX

nginx -s reload

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM