LoginSignup
1
1

More than 3 years have passed since last update.

【Laravel】local.ERROR: GD Library extension not available with this PHP installation.

Posted at

エラー内容

local.ERROR: GD Library extension not available with this PHP installation. {"exception":"[object] (Intervention\\Image\\Exception\\NotSupportedException(code: 0): GD Library extension not available with this PHP installation.

環境

Amazon Linux release 2
Laravel Framework 6.18.11
PHP 7.3.16

やっていたこと

以下の内容はエラーがでる以前からやっていたことです。

$ composer require intervention/image
config/app.php
Intervention\Image\ImageServiceProvider::class,

'Image' => Intervention\Image\Facades\Image::class,

やったこと

エラー解決に至るまで。

まず画像処理に必要なPHPの拡張モジュールをインストールする。

利用できるパッケージの検索
$ sudo yum search "php-gd"
読み込んだプラグイン:extras_suggestions, langpacks, priorities, update-motd
============================ N/S matched: php-gd ============================
php-gd.x86_64 : A module for PHP applications for using the gd graphics library
パッケージのインストール
$ sudo yum install php-gd.x86_64
Nginxの再起動
$ sudo systemctl restart nginx
OSの再起動
$ sudo reboot

注意

Nginxの再起動だけでは、エラーの解決には至りませんでした。オペレーティングシステムの再起動をすることでエラーが解決しました。

参考

1
1
0

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
1
1