尝试安装elfinder-laravel时出现Composer错误

时间:2015-04-21 16:08:13

标签: php composer-php elfinder

我尝试在Laravel 5中安装Laravel-elfinder。在它的GitHub page 我已经按照一步一步的教程进行了操作,但它无法正常工作。

我在装有Windows 8的Windows PC上安装了XAMPP Web服务器。

基本上我要去我的项目文件夹并执行

composer require barryvdh/laravel-elfinder

几秒钟后我收到了这个错误:

C:\xampp\htdocs\edent>composer require barryvdh/laravel-elfinder
Using version 0.3.* for barryvdh/laravel-elfinder
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - barryvdh/laravel-elfinder v0.3.0 requires barryvdh/elfinder-flysystem-driv
er 0.1.x@dev -> satisfiable by barryvdh/elfinder-flysystem-driver[0.1.0].
    - barryvdh/laravel-elfinder v0.3.1 requires barryvdh/elfinder-flysystem-driv
er 0.1.x@dev -> satisfiable by barryvdh/elfinder-flysystem-driver[0.1.0].
    - barryvdh/laravel-elfinder v0.3.2 requires barryvdh/elfinder-flysystem-driv
er 0.1.x@dev -> satisfiable by barryvdh/elfinder-flysystem-driver[0.1.0].
    - barryvdh/laravel-elfinder v0.3.3 requires barryvdh/elfinder-flysystem-driv
er 0.1.x@dev -> satisfiable by barryvdh/elfinder-flysystem-driver[0.1.0].
    - barryvdh/elfinder-flysystem-driver 0.1.0 requires intervention/image ~2.0
-> satisfiable by intervention/image[2.0.0, 2.0.1, 2.0.10, 2.0.11, 2.0.12, 2.0.1
3, 2.0.14, 2.0.15, 2.0.16, 2.0.17, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0
.8, 2.0.9, 2.1.0, 2.1.1, 2.1.2, 2.1.3].
    - intervention/image 2.1.3 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.1.2 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.1.1 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.1.0 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.0.9 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.0.8 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.0.7 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.0.6 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.0.5 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.0.4 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.0.3 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.0.2 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.0.17 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.0.16 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.0.15 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.0.14 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.0.13 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.0.12 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.0.11 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.0.10 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.0.1 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.0.0 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - Installation request for barryvdh/laravel-elfinder 0.3.* -> satisfiable by
 barryvdh/laravel-elfinder[v0.3.0, v0.3.1, v0.3.2, v0.3.3].


Installation failed, reverting ./composer.json to its original content.

有没有人知道如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

您通过编辑器安装的所有公共包都是packagist.org中的“可搜索”。所以,如果你在packagist中搜索laravel-elfinder,你最终会at this page

在那里,您会看到需要的列表,这意味着您看到的包依赖于另一个包,在安装之前您将无法使用所需的包那些依赖。但是,由于Composer非常聪明,它会尝试为您解决这些依赖关系。

在您的情况下,Composer会尽可能地解析。基本上, barryvdh/laravel-elfinder 取决于 barryvdh/elfinder-flysystem-driver ,而 intervention/image 依赖于 PHP For Windows 。如果你转到后面的软件包,你会看到Requires列表:

  

<强>要求
  php:&gt; = 5.3.0
  ext-fileinfo:*

我写了这一切,所以你可以理解为什么,在你的消息转储中,你看到多条消息说明

  

干预/图像2.1.3 需要ext-fileinfo * - &gt;系统中缺少所请求的PHP扩展文件信息。

基本上,这意味着您需要在PHP安装中启用扩展 fileinfo

首先,打开php.ini并检查您是否没有评论扩展程序。寻找这样的东西:

#[PHP_FILEINFO]
#extension=php_fileinfo.dll

如果找到,请取消注释(删除#)并重新启动XAMPP。

如果不这样做,您将需要php_fileinfo.dll下载页面中的文件.zip,该文件与您安装PHP的ext文件相符将在php.ini文件夹中找到该文件。

将该文件复制到您的扩展程序文件夹中,修改[PHP_FILEINFO] extension=php_fileinfo.dll 并添加此

composer

重启你的XAMPP,你就完成了。

安装扩展程序后,再次运行{{1}}命令。