16
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

LaravelでGD Library extension not available with this PHP installation.のエラーが出た時の対処法

Last updated at Posted at 2019-03-24

##環境
PHP:v7.0.31
Laravel:v5.5
IDE:cloud9

##エラー内容

composer require intervention/image

も実行した。

config/app.php
//provider
Intervention\Image\ImageServiceProvider::class,
//aliases
'Image' => Intervention\Image\Facades\Image::class,

この2つも追加した。

app/http/Controllers/PhotosController.php
use Image;

も対象のコントローラのトップに追加してある。
しかしながら、以下

Driver.php
GD Library extension not available with this PHP installation.

このエラーが出る。

##なんと
実は、「Intervention/image」はPHP5.4以上で画像処理ライブラリのGDまたはImageMagickがインストールされている必要があるそうです。てことでGDをインストールします。

sudo apt-get update
sudo apt-get install php7.0-gd

以上2つのコマンドをターミナルでうち、apache再起動すれば動くと思います。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?