您的系统中缺少请求的 PHP 扩展 dom

新手上路,请多包涵

所以我刚刚安装了 Scotchbox(一个 vagrant 设置)。 https://github.com/scotch-io/scotch-box

当我收到以下错误时,我正在尝试安装作曲家依赖项。

 Problem 1
- phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- Installation request for phpunit/php-code-coverage (locked at 4.0.8) -> satisfiable by phpunit/php-code-coverage[4.0.8].

我试过的

其他一些线程建议这包含在 php-xml 包中。我试着安装这个

sudo apt-get install php7.0-xml
sudo service apache2 restart

但这没有用。知道其他解决方案可能有用吗?我开始拔头发。

原文由 Miguel Stevens 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.1k
2 个回答

对我来说,选择的答案不起作用。

这确实有效:

 sudo apt-get install php-xml

这是在带有 PHP 7 的 Ubuntu 16.04 上。

原文由 Mubashar Abbas 发布,翻译遵循 CC BY-SA 4.0 许可协议

在 PHP 7.4 上试试这个:

 sudo apt-get install php7.4-xml

对于 PHP 8.0:

 sudo apt-get install php8.0-xml

原文由 Pejman Kheyri 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题