Composer 更新 Laravel、ext-fileinfo

问题描述 投票:0回答:1

我在 Laravel 框架中遇到了 Composer 的问题。这是作曲家日志:

`update --no-interaction
 Loading composer repositories with package information
 Updating dependencies
 Your requirements could not be resolved to an installable set of packages.
 
   Problem 1
     - laravel/framework[v10.10.0, ..., v10.44.0] require league/flysystem ^3.8.0 -> satisfiable by league/flysystem[3.8.0, ..., 3.24.0].
     - league/flysystem[3.3.0, ..., 3.14.0] require league/mime-type-detection ^1.0.0 -> satisfiable by league/mime-type-detection[1.0.0, ..., 1.15.0].
     - league/flysystem[3.15.0, ..., 3.24.0] require league/flysystem-local ^3.0.0 -> satisfiable by league/flysystem-local[3.15.0, ..., 3.23.1].
     - league/mime-type-detection[1.0.0, ..., 1.3.0] require php ^7.2 -> your php version (8.3.3) does not satisfy that requirement.
     - league/mime-type-detection[1.4.0, ..., 1.15.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
     - league/flysystem-local[3.15.0, ..., 3.23.1] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
     - Root composer.json requires laravel/framework ^10.10 -> satisfiable by laravel/framework[v10.10.0, ..., v10.44.0].
 
 To enable extensions, verify that they are enabled in your .ini files:
     - F:\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-fileinfo` to temporarily ignore these required extensions.
 `

我在 Laravel 框架中遇到了 Composer 的问题。尽管在我的 php.ini 中激活了 php_fileinfo 扩展并更新了 PHP 和 Composer,问题仍然存在。

我使用带有内置服务器的 PHP Storm 和 Laravel。这是我到目前为止所做的尝试:

  1. 在 php.ini 中激活 php_fileinfo 扩展。
  2. 更新了 PHP 解释器和编写器。
  3. 更改 php.ini 后重新启动服务器。
  4. 验证extension=php_fileinfo.dll是否正确配置并取消注释。
  5. 使用composerclear-cache清除了Composer缓存。
  6. 尝试通过删除并运行composer install来重新创建composer.lock文件。
  7. 检查了 config/database.php 中 Laravel 的数据库配置。
  8. 确保 Laravel 项目中正确的文件权限。

尽管做出了这些努力,问题仍然存在。任何进一步的指导或帮助将不胜感激。

 composer create-project laravel/laravel example-app

确诊:

Checking composer.json: OK
 Checking platform settings: OK
 Checking git settings: OK git version 2.39.1
 Checking http connectivity to packagist: OK
 Checking https connectivity to packagist: OK
 Checking github.com rate limit: OK
 Checking disk free space: OK
Checking Composer version: OK
 Checking Composer and its dependencies for vulnerabilities: OK
 Composer version: 2.7.1
 PHP version: 8.3.3
 PHP binary path: F:\php\php.exe
 OpenSSL version: OpenSSL 3.0.13 30 Jan 2024
 cURL version: 8.6.0 libz 1.2.12 ssl OpenSSL/3.0.13
 zip: extension not loaded, unzip not available, 7-Zip not available
php laravel composer-php
1个回答
0
投票

尝试重新安装composer,它对我有用

© www.soinside.com 2019 - 2024. All rights reserved.