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 <
for php -v 7.1
sudo apt-get install php7.1-gd
works for me
For my fellow Windows users, find the line ;extension=gd2
in your php.ini
file and change it to extension=gd2
.
Regards
@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 )
.
The GD Graphics Library is for dynamically manipulating images. For Ubuntu you should install it manually:
sudo apt-get install php5-gd
sudo apt-get install php7.0-gd
sudo apt-get install php7.1-gd
sudo apt-get install php7.2-gd
sudo apt-get install php7.3-gd
sudo apt-get install php7.4-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
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.
Php 5.6 worked with below command
PHP5.6: sudo apt-get install php5.6-gd
after installing restart server
sudo service apache2 restart