系统中缺少PHP扩展文件信息的Composer错误
P粉465675962
P粉465675962 2023-10-18 11:47:04
0
2
522

我正在尝试安装 Laravel 包干预图像,当我运行 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.iniphpinfo() 中启用了扩展:

fileinfo

fileinfo support                  enabled
version                           1.0.5

并重新启动了apache...但仍然没有运气。

P粉465675962
P粉465675962

全部回复(2)
P粉702946921

Windows 用户:只需编辑 php.ini 并取消注释此行:

extension=php_fileinfo.dll

记得重新启动 Apache 以使新的 php.ini 生效。

P粉277464743

显然这是因为 web/apache 和 CLI 有单独的 php.ini 文件,并且作曲家使用 CLI 而 phpinfo() 使用主 php.ini出现问题。

如果您在 CLI 中运行 php -m 并且没有看到模块的名称,您应该找到 CLI php.ini (在我的例子中 php- cli.ini 并添加扩展名。例如 extension=php_fileinfo.dll

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!