0

I have installed intervention/image.

This is what I got from tinker:

C:\Users\USER\p3>composer require intervention/image
Using version ^2.5 for intervention/image
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: intervention/image
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.

then I used the package like this:

use Intervention\Image\Facades\Image

then I applied the code like this:

image = Image::make(public_path("storage/{$imagePath}"))->fit(1200, 1200);`

The error I get is:

Intervention\Image\Exception\NotSupportedException GD Library extension not available with this PHP installation.

Any suggestions on how I can fix this?

theduck
  • 2,589
  • 13
  • 17
  • 23
  • You need to install the [GD](https://www.php.net/manual/en/book.image.php) library for your PHP Installation. You can check how to install it here: [GD Library extension not available with this PHP installation Ubuntu Nginx](https://stackoverflow.com/a/34010095/2392957) – alexey-novikov Jan 04 '20 at 15:07
  • I'm using commande line on windows, could not use sudo, sorry if it's abvious but i'm new. this line is not instaling it> C:\Users\USER\p3>composer require intervention/imag – Mourad Mohammed Benosman Jan 04 '20 at 15:12

2 Answers2

0

I was getting this issue too. I bought it while developing code with Laravel. Ubuntu; apt-get install libpng-dev Centos; yum install libpng-devel This has been resolved with downloads.

Zendem
  • 490
  • 5
  • 8
0

It say's that in your system GD library isn't available Here is steps to enable GD library

sudo apt-get install php7.4-gd

After installation find your php.ini file and uncomment

extension=gd for mac extension=php_gd2.dll for windows or ubntu