您的要求无法解决为 laravel 的一组可安装的软件包

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52734707/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:06:34  来源:igfitidea点击:

Your requirements could not be resolved to an installable set of packages for laravel

phplaravel

提问by Seyed Masih Tabaei

I use 5.7v Laravel and 7.2.1v PHP and composer last version, but when I like to create new project these errors appeared:

我使用 5.7v Laravel 和 7.2.1v PHP 和 composer 最后一个版本,但是当我想创建新项目时,出现了这些错误:

Your requirements could not be resolved to an installable set of packages.

Problem 1
    - Installation request for league/flysystem 1.0.47 -> satisfiable by league/flysystem[1.0.47]. 
    - league/flysystem 1.0.47 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
Problem 2  
    - league/flysystem 1.0.47 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.  
    - laravel/framework v5.7.9 requires league/flysystem ^1.0.8 -> satisfiable by league/flysystem[1.0.47]. 0 
    - Installation request for laravel/framework v5.7.9 -> satisfiable by laravel/framework[v5.7.9].

To enable extensions, verify that they are enabled in your .ini files:
    - C:\php-7\php.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.`

回答by Udhav Sarvaiya

First of all, stop the XAMPP/Wamp and then kindly remove the starting semicolon ( ;) from your xampp\php\php.inithe following code.

首先,停止 XAMPP/Wamp,然后;从您的xampp\php\php.ini 中删除起始分号 ( )以下代码。

;extension=fileinfo

And then restart your XAMPP/Wamp.

然后重新启动您的 XAMPP/Wamp。



NOTE:For Windows, you can find the file in the C:\xampp\php\php.ini-Folder (Windows) or in the etc-Folder (within the xampp-Folder).

注意:对于 Windows,您可以在C:\xampp\php\php.ini-Folder (Windows) 或 etc-Folder(在 xampp-Folder 内)中找到该文件。

回答by Aranya Sen

The problem seems to be what the error message says - your system is missing fileinfoPHP extension. Since you're on Windows, open C:\php-7\php.inifile, search for the following line, and remove the beginning ;if exists: extension=fileinfo

问题似乎是错误消息所说的 - 您的系统缺少fileinfoPHP 扩展名。由于您在 Windows 上,打开C:\php-7\php.ini文件,搜索以下行,;如果存在,则删除开头: extension=fileinfo

回答by Ninad Muranjan

Just uncommentextension=fileinfoin php.iniit worked for me even without xampp

只要取消注释extension=fileinfophp.ini它的工作对我来说,即使没有XAMPP

回答by blongho

In my case, I had both installed PHP and XAMPP and in my path, i pointed at C:/php/as the PHP interpreter. In C:/php/php.ini, it was ;extension=fileinfowhereas in C:/xampp/php/php.iniit was extension=fileinfo. I did two changes,

就我而言,我已经安装了 PHP 和 XAMPP,并且在我的路径中,我指的C:/php/是 PHP 解释器。在C:/php/php.ini,它是,;extension=fileinfo而在C:/xampp/php/php.ini它是extension=fileinfo。我做了两个改变,

  1. Deleted C:/php/
  2. Changed my path to PHP to point to c:/xampp/php/
  1. 已删除 C:/php/
  2. 将我的 PHP 路径更改为指向 c:/xampp/php/

The problem is now resolved

问题现已解决

回答by Milan Dulal

In my case I just uncomment extension=fileinfoin php.inithen it works

在我来说,我只是取消注释extension=fileinfophp.ini,然后它的工作原理