首頁  >  問答  >  主體

系統中缺少PHP擴充檔案資訊的Composer錯誤

我正在嘗試安裝 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粉465675962P粉465675962337 天前531

全部回覆(2)我來回復

  • P粉702946921

    P粉7029469212023-10-19 10:56:39

    Windows 使用者:只需編輯 php.ini 並取消註解此行:

    extension=php_fileinfo.dll

    記得重新啟動 Apache 以使新的 php.ini 生效。

    回覆
    0
  • P粉277464743

    P粉2774647432023-10-19 00:34:25

    顯然這是因為 web/apache 和 CLI 有單獨的 php.ini 文件,而作曲家使用 CLI 而 phpinfo() 使用主 php.ini出現問題。

    如果您在CLI 中執行php -m 並且沒有看到模組的名稱,您應該會找到CLI php.ini(在我的範例中php- cli.ini 並新增副檔名。例如extension=php_fileinfo.dll

    回覆
    0
  • 取消回覆