每當我嘗試建立新專案時,我都會收到此錯誤。關於它可能是什麼有什麼想法嗎?
Problem 1 - laravel/framework[v8.75.0, ..., 8.x-dev] require league/flysystem ^1.1 -> satisfiable by league/flysystem[1.1.0, ..., 1.x-dev]. - league/flysystem[1.1.0, ..., 1.x-dev] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension. - Root composer.json requires laravel/framework ^8.75 -> satisfiable by laravel/framework[v8.75.0, ..., 8.x-dev]. To enable extensions, verify that they are enabled in your .ini files: - C:\PHP7\php.ini You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can run Composer with `--ignore-platform-req=ext-fileinfo` to temporarily ignore these required extensions.
錯誤告訴您到底發生了什麼事。
laravel/框架需要flysystem。 Flysystem 需要 PHP 的 fileinfo 擴充功能。
這似乎已被禁用。
按照提示轉到您的
php.ini
檔案(C:\PHP7\php.ini
),編輯php.ini
例如,使用記事本建立文件。CTRL F
並搜尋fileinfo
(如果您想徹底搜尋extension=php_fileinfo.dll
)。它前面應該有一個分號(
;
),這表示它已被註解掉,因此被停用。刪除分號並再次執行這些步驟。現在應該可以工作了。