root@hecs-215330:/www/wwwroot/server-main# composer install
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
- phpoffice/phpspreadsheet is locked to version 1.18.0 and an update of this package was not requested.
- phpoffice/phpspreadsheet 1.18.0 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:
- /www/server/php/74/etc/php-cli.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-fileinfo` to temporarily ignore these required extensions.
我们执行 composer update,还是报错
root@hecs-215330:/www/wwwroot/server-main# composer update
Loading composer repositories with package information
https://repo.packagist.org could not be fully loaded (curl error 28 while downloading https://repo.packagist.org/packages.json: Failed to connect to repo.packagist.org port 443: Connection timed out), package information was loaded from the local cache and may be out of date
配置国内镜像
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
再次执行 composer update,还是报错
root@hecs-215330:/www/wwwroot/server-main# composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- phpoffice/phpspreadsheet[1.17.0, ..., 1.29.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- Root composer.json requires phpoffice/phpspreadsheet ^1.17 -> satisfiable by phpoffice/phpspreadsheet[1.17.0, ..., 1.29.0].
To enable extensions, verify that they are enabled in your .ini files:
- /www/server/php/74/etc/php-cli.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-fileinfo` to temporarily ignore these required extensions.
安装 php 的 fileinfo 拓展,再次执行 composer update,一切ok。