我有 ext-fileinfo 但 Composer 说它丢失了 [英] I have ext-fileinfo but Composer says it is missing
问题描述
我正在尝试安装 Laravel 包 Intervention Image,当我运行 composer update
时:
I'm trying to install Laravel package Intervention Image and when I run composer update
:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- intervention/image 2.0.5 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- intervention/image 2.0.4 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- intervention/image 2.0.3 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- intervention/image 2.0.2 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- intervention/image 2.0.1 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- intervention/image 2.0.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- Installation request for intervention/image 2.* -> satisfiable by intervention/image[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5].
我有 php 5.4 并且在 php.ini
和 phpinfo()
中启用了扩展:
I have php 5.4 and the extension is enabled in php.ini
, and in phpinfo()
:
fileinfo
fileinfo support enabled
version 1.0.5
并重新启动 apache ......但仍然没有运气.
and restarted apache... but still no luck.
推荐答案
显然是因为 web/apache 和 CLI 有单独的 php.ini
文件,而 composer 使用 CLI 和 phpinfo() 使用主 php.ini
出现问题.
Apparently it is because there are separate php.ini
files for web/apache and CLI and as composer uses the CLI and phpinfo() uses the main php.ini
the problem occurs.
如果您在 CLI 中运行 php -m
并且没有看到模块的名称,您应该找到 CLI php.ini
(在我的例子中是 php-cli.ini
并添加扩展名.例如 extension=php_fileinfo.dll
If you run php -m
in CLI and don't see the module's name you should find the CLI php.ini
(in my case php-cli.ini
and add the extension. e.g. extension=php_fileinfo.dll
这篇关于我有 ext-fileinfo 但 Composer 说它丢失了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!