I am using Laravel
web framework on my ubuntu 14.04
server and Nginx
web server, I have this error when I try to upload a file using Laravel
to the server. my upload directory is on the public/uploads
folder that has 777 permission.
asked Nov 30, 2015 at 23:21
Saeed VazirySaeed Vaziry
2,0255 gold badges23 silver badges38 bronze badges
1
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
- PHP8.1:
sudo apt-get install php8.1-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
answered Nov 30, 2015 at 23:42
Limon MonteLimon Monte
49.9k44 gold badges174 silver badges209 bronze badges
6
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
answered Dec 27, 2020 at 1:29
ArinzehillsArinzehills
8955 silver badges11 bronze badges
2
For my fellow Windows users, find the line ;extension=gd2
in your php.ini
file and change it to extension=gd2
.
Regards
answered Oct 10, 2020 at 14:46
2
@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 to PHP 7.0.8-0ubuntu0.16.04.2 [cli] [ NTS ]
.
answered Aug 27, 2016 at 13:00
user3278087user3278087
4075 silver badges13 bronze badges
for php -v 7.1
sudo apt-get install php7.1-gd
works for me
answered Jul 13, 2017 at 12:43
Php 5.6 worked with below command
PHP5.6: sudo apt-get install php5.6-gd
after installing restart server
sudo service apache2 restart
answered Aug 6, 2018 at 6:12
HemamaliniHemamalini
7017 silver badges9 bronze badges
Go to your xampp serve:
After that, you just click on the Apache config button and you get an option on PHP[php.ini]
. Click this option and then it will be open on code editor.
After that, you will search a file gd
and you get ;extension=gd
this option. Remove the;
from extension=gd
and then save
it.
Then restart your server again, then it will be work properly.
halfer
19.6k17 gold badges92 silver badges175 bronze badges
answered Mar 29, 2021 at 4:17
1
In my case under Archlinux:
pacman -S php-gd
php-gd
then in your php.ini
for me in /etc/php/php.ini
uncomment line ;extension=gd.so
by removing semicolon.
Don't forget to restart the server.
answered Jun 4, 2017 at 10:05
JTCJTC
3,1943 gold badges28 silver badges44 bronze badges
If you are using Xampp PHP Version 8.* , on xampp control panel, click
on config under apache and select PHP[php.ini]
, this will open php.ini config file. Search for ;extension=gd
and Change it to extension=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
to extension=gd
on php.ini config file. Restart Xampp and that is it!
answered Jul 28, 2021 at 6:23
If you are using Wnmp PHP
version 8.*, on Wnmp look for php.ini located at C:\Wnmp\php. Remove the comment ;extension=gd
to extension=gd
Then restart the Nginx on Wnmp
answered Jul 4 at 3:25
TwoTwo
4334 silver badges15 bronze badges
"require": {
"php": "^8.0.2",
"laravel/framework": "^9.2",
"league/flysystem-aws-s3-v3": "^3.0",
"ext-gd": "*",
.....
},
answered Aug 12 at 19:24