laravel - GD Library extension not available with this PHP installation Ubuntu Nginx
Get the solution ↓↓↓I am usingLaravel
web framework on myubuntu 14.04
server andNginx
web server, I have this error when I try to upload a file usingLaravel
to the server.
my upload directory is on thepublic/uploads
folder that has 777 permission.
Answer
Solution:
The GD Graphics Library is for dynamically manipulating images. For Ubuntu you should install it manually:
- PHP5:
sudo apt-get install php5-gd
- PHP7.0:
sudo apt-get install php7.0-gd
- PHP7.1:
sudo apt-get install php7.1-gd
- PHP7.2:
sudo apt-get install php7.2-gd
- PHP7.3:
sudo apt-get install php7.3-gd
- PHP7.4:
sudo apt-get install php7.4-gd
- PHP8.0:
sudo apt-get install php8.0-gd
That's all, you can verify that GD support loaded:
php -i | grep -i gd
Output should be like this:
GD Support => enabled
GD headers Version => 2.1.1-dev
gd.jpeg_ignore_warning => 0 => 0
and finally restart your apache:
sudo service apache2 restart
Answer
Solution:
window users using xampp apache server.
Go to php folder in xampp and open the php.ini and php configurations settings file, and change the line ;extension=gd2 or the line ;extension=gd to just extension=gd2
NB that php version 8 is stored as ;extension=gd
Answer
Solution:
@limonte's answer is correct, but if you're using PHP7+, you should use following command:
sudo apt-get install php7.0-gd
If you don't know what version of PHP you're using, just type
php -v
Output should start with something similar toPHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
.
Answer
Solution:
For my fellow Windows users, find the line;extension=gd2
in yourphp.ini
file and change it toextension=gd2
.
Regards
Answer
Solution:
for php -v 7.1
sudo apt-get install php7.1-gd
works for me
Answer
Solution:
Php 5.6 worked with below command
PHP5.6:sudo apt-get install php5.6-gd
after installing restart server
sudo service apache2 restart
Answer
Solution:
In my case under Archlinux:
pacman -S php-gd
then in yourphp.ini
for me in/etc/php/php.ini
uncomment line;extension=gd.so
by removing semicolon.
Don't forget to restart the server.
Answer
Solution:
If you are using Xampp PHP Version 8.* , on xampp control panel, click on config under apache and selectPHP(php.ini)
, this will open php.ini config file. Search for;extension=gd
and Change it toextension=gd
. It is not a must you follow this process to get to php.ini, the most important thing is that you have to change;extension=gd
toextension=gd
on php.ini config file. Restart Xampp and that is it!
Answer
Solution:
Go to your xampp serve:
After that, you just click on the Apache config button and you get an option onPHP(php.ini)
. Click this option and then it will be open on code editor.
After that, you will search a filegd
and you get;extension=gd
this option. Remove the;
fromextension=gd
and then save it.
Then restart your server again, then it will be work properly.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: to enable extensions, verify that they are enabled in your .ini files
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.