Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Intervention Image GD library extension

Tags:

php

laravel

First of all, I am sorry if my question may be too vague. So, I will try to clarify my question as much as possible.

I am currently developing a Laravel application, and I am trying to use Intervention Image Facade. When I tried to use it to test an upload, I got the following error:-

NotSupportedException in Driver.php line 16: GD Library extension not available with this PHP installation.

So, as I would try to do, I installed the GD library using sudo apt-get install libgd3 and the php gd driver using sudo apt-get php5.6-gd. However, this did not work, and the same error keeps popping up in laravel. What have I clearly missed, and what should I follow next?

Edit 1. I used the following command to see if php actually supports gd driver : - php -i | grep -i --color gd

The following result came: -

/etc/php/5.6/cli/conf.d/20-gd.ini,
gd
GD Support => enabled
GD headers Version => 2.2.3
GD library Version => 2.2.3
gd.jpeg_ignore_warning => 0 => 0
GDM_LANG => en_US
GDMSESSION => ubuntu
_SERVER["GDM_LANG"] => en_US
_SERVER["GDMSESSION"] => ubuntu

Hope this helps even more.

EDIT 2 Thanks to all who answered. I found my solution in Mayank Pandey's answer.

like image 315
Kavinda Keshan Rasnayake Avatar asked Oct 12 '16 04:10

Kavinda Keshan Rasnayake


2 Answers

This is because the GD Library is missing on your server For PHP 8.x

Find your (proper) php.ini file, and then find the line:enter image description here

;extension=gd, remove the semicolon in the front. ; means the line is commented, so remove the comment.

The line should look like this:

extension=gd

Then restart apache and you are ready to go.

NOTE: If You are using php version <=7.x

;extension=php_gd2.dll, itshould look like this: extension=php_gd2.dll

like image 170
Haron Avatar answered Sep 27 '22 16:09

Haron


This is because the GD Library is missing on your server.

You must enable the library GD2.

Find your (proper) php.ini file, and then find the line:

;extension=php_gd2.dll, remove the semicolon in the front. ; means the line is commented, so remove the comment)

The line should look like this:

extension=php_gd2.dll

Then restart apache and you are ready to go.

like image 20
Mayank Pandeyz Avatar answered Sep 27 '22 16:09

Mayank Pandeyz