我正在嘗試安裝 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.ini
和 phpinfo()
中啟用了擴充功能:
fileinfo fileinfo support enabled version 1.0.5
並重新啟動了apache...但仍然沒有運氣。
Windows 使用者:只需編輯
php.ini
並取消註解此行:記得重新啟動 Apache 以使新的 php.ini 生效。
顯然這是因為 web/apache 和 CLI 有單獨的
php.ini
文件,而作曲家使用 CLI 而 phpinfo() 使用主php.ini
出現問題。如果您在CLI 中執行
php -m
並且沒有看到模組的名稱,您應該會找到CLIphp.ini
(在我的範例中php- cli.ini
並新增副檔名。例如extension=php_fileinfo.dll