LoginSignup
3
2

More than 1 year has passed since last update.

Laravelインストール時に「PHP拡張モジュールがない」というエラーが発生し、php.iniを修正して対応

Posted at

laravelをインストールする際、下記エラーメッセージが発生。

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework[v9.2.0, ..., 9.x-dev] require league/flysystem ^3.0 -> satisfiable by league/flysystem[3.0.0, ..., 3.x-dev].
    - league/flysystem[3.0.0, ..., 3.x-dev] require league/mime-type-detection ^1.0.0 -> satisfiable by league/mime-type-detection[1.0.0, ..., 1.9.0].
    - league/mime-type-detection[1.0.0, ..., 1.3.0] require php ^7.2 -> your php version (8.1.3) does not satisfy that requirement.
    - league/mime-type-detection[1.4.0, ..., 1.9.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
    - Root composer.json requires laravel/framework ^9.2 -> satisfiable by laravel/framework[v9.2.0, ..., 9.x-dev].

To enable extensions, verify that they are enabled in your .ini files:
    - C:\php-8.1.3\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.

エラー内容を確認するに、PHP拡張モジュールがないとのこと。
php.iniのファイル内で有効化されていないようなので、php.iniを修正することで対応。

;extension=gd
↓
extension=gd
;extension=gd
↓
extension=gd
;extension=fileinfo
↓
extension=fileinfo

以上の変更を加えることで、Laravelをインストールできるようになった。

※参考にした記事
https://qiita.com/sola-msr/items/95e06e66730468b6c7bc

3
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2