laravel报错:requires ext-dom * -> the requested PHP extension dom is missing from your system.

在尝试安装或更新Laravel应用时遇到了错误,提示缺少PHP的DOM扩展。要修复此问题,你需要安装XML插件。对于PHP 7.4版本,可以使用`sudo apt install php7.4-xml`命令。确保安装对应你当前PHP版本的正确扩展,重启服务器后,错误应当消除,允许你继续进行Laravel的安装或更新过程。

laravel报错:requires ext-dom * -> the requested PHP extension dom is missing from your system.
出错信息如下:

Crafting application…
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

Problem 1
– Installation request for tijsverkoyen/css-to-inline-styles 2.2.2 -> satisfiable by tijsverkoyen/css-to-inline-styles[2.2.2].
– tijsverkoyen/css-to-inline-styles 2.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 2
– Installation request for phar-io/manifest 1.0.3 -> satisfiable by phar-io/manifest[1.0.3].
– phar-io/manifest 1.0.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 3
– Installation request for phpunit/php-code-coverage 7.0.10 -> satisfiable by phpunit/php-code-coverage[7.0.10].
– phpunit/php-code-coverage 7.0.10 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 4
– Installation request for phpunit/phpunit 8.4.3 -> satisfiable by phpunit/phpunit[8.4.3].
– phpunit/phpunit 8.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 5
– Installation request for theseer/tokenizer 1.1.3 -> satisfiable by theseer/tokenizer[1.1.3].
– theseer/tokenizer 1.1.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 6
– tijsverkoyen/css-to-inline-styles 2.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– laravel/framework v6.6.1 requires tijsverkoyen/css-to-inline-styles ^2.2.1 -> satisfiable by tijsverkoyen/css-to-inline-styles[2.2.2].
– Installation request for laravel/framework v6.6.1 -> satisfiable by laravel/framework[v6.6.1].

错误信息中没有明确信息是缺少哪个扩展,解决方法:

安装xml插件即可解决:

根据你的php版本去选择
先搜索扩展 apt-cache search xml| grep php
sudo apt install php7.4-xml
Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Your lock file does not contain a compatible set of packages. Please run composer update. Problem 1 - Root composer.json requires PHP extension ext-redis * but it is missing from your system. Install or enable PHP's redis extension. Problem 2 - endroid/qrcode is locked to version 3.6.0 and an update of this package was not requested. - endroid/qrcode 3.6.0 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension. Problem 3 - fastknife/ajcaptcha is locked to version v1.1.5 and an update of this package was not requested. - fastknife/ajcaptcha v1.1.5 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension. Problem 4 - intervention/image is locked to version 2.7.2 and an update of this package was not requested. - intervention/image 2.7.2 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension. Problem 5 - league/flysystem is locked to version 1.0.69 and an update of this package was not requested. - league/flysystem 1.0.69 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension. Problem 6 - mpdf/mpdf is locked to version v8.0.6 and an update of this package was not requested. - mpdf/mpdf v8.0.6 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension. Problem 7 - overtrue/wechat is locked to version 4.2.20 and an update of this package was not requested. - overtrue/wechat 4.2.20 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension. Problem 8 - setasign/fpdf is locked to version 1.8.4 and an update of this package was not requested. - setasign/fpdf 1.8.4 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension. Problem 9 - simplesoftwareio/simple-qrcode is locked to version 4.2.0 and an update of this package was not requested. - simplesoftwareio/simple-qrcode 4.2.0 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension. Problem 10 - symfony/translation is locked to version v6.0.0 and an update of this package was not requested. - symfony/translation v6.0.0 requires php >=8.0.2 -> your php version (7.4.0) does not satisfy that requirement. Problem 11 - symfony/translation-contracts is locked to version v3.0.0 and an update of this package was not requested. - symfony/translation-contracts v3.0.0 requires php >=8.0.2 -> your php version (7.4.0) does not satisfy that requirement. Problem 12 - cache/filesystem-adapter is locked to version 1.0.0 and an update of this package was not requested. - cache/filesystem-adapter 1.0.0 requires league/flysystem ^1.0 -> satisfiable by league/flysystem[1.0.69]. - league/flysystem 1.0.69 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension. To enable extensions, verify that they are enabled in your .ini files: - E:\software\php\php.ini You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can run Composer with `--ignore-platform-req=ext-redis --ignore-platform-req=ext-gd --ignore-platform-req=ext-fileinfo` to temporarily ignore these required extensions.
最新发布
08-21
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值