主页 介绍 动态 应用 帮助 授权 论坛 文档
首页 / 综合讨论 / linux下执行 composer install 安装 失败

linux下执行 composer install 安装 失败

官方发言人 综合讨论 发布于 2026-06-23 09:16:09 湖北 广电网/铁通(电信出口) 👁 13 💬 1
[root@iZ5ts8xp07gb2uagpsv0vmZ cmspro.cn]# php -v
PHP 8.3.27 (cli) (built: Oct 27 2025 10:30:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.27, Copyright (c) Zend Technologies
[root@iZ5ts8xp07gb2uagpsv0vmZ bang.fan]# composer install
PHP Deprecated:  Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112

Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/Repository/ArrayRepository.php:277
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/Repository/ArrayRepository.php:277
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/Repository/ArrayRepository.php:277
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:777
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:782
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Deprecation Notice: Return type of Composer\DependencyResolver\Pool::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/Pool.php:76
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSet.php:116
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSet::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSet.php:101
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/Decisions.php:155
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/Decisions.php:165
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/Decisions.php:160
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/Decisions.php:170
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/Decisions.php:150
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/Decisions.php:145
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:36
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:46
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:41
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:89
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSetIterator.php:70
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/bin/composer/src/Composer/DependencyResolver/Problem.php:308
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - alipaysdk/easysdk is locked to version 2.2.3 and an update of this package was not requested.
    - alipaysdk/easysdk 2.2.3 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
  Problem 2
    - laravel/framework is locked to version v13.9.0 and an update of this package was not requested.
    - laravel/framework v13.9.0 requires composer-runtime-api ^2.2 -> found composer-runtime-api[2.0.0] but it does not match the constraint.
  Problem 3
    - laravel/prompts is locked to version v0.3.18 and an update of this package was not requested.
    - laravel/prompts v0.3.18 requires composer-runtime-api ^2.2 -> found composer-runtime-api[2.0.0] but it does not match the constraint.
  Problem 4
    - league/flysystem-local is locked to version 3.31.0 and an update of this package was not requested.
    - league/flysystem-local 3.31.0 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
  Problem 5
    - league/mime-type-detection is locked to version 1.16.0 and an update of this package was not requested.
    - league/mime-type-detection 1.16.0 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
  Problem 6
    - laravel/framework v13.9.0 requires composer-runtime-api ^2.2 -> found composer-runtime-api[2.0.0] but it does not match the constraint.
    - laravel/pail v1.2.6 requires illuminate/console ^10.24|^11.0|^12.0|^13.0 -> satisfiable by laravel/framework[v13.9.0].
    - laravel/pail is locked to version v1.2.6 and an update of this package was not requested.

To enable extensions, verify that they are enabled in your .ini files:
    - /www/server/php/83/etc/php-cli.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

💬 回复 (1)

1
官方发言人 2026-06-23 10:12:26 湖北
  1. 安装并开启 fileinfo 扩展
  2. 升级composer,执行 composer self-update