Enabling/installing GD extension? --without-gd

Viewed 275796

How does one enable (or perhaps I need to install) GD when my phpinfo() output in "Configure Command" says; --without-gd ?

I also have nothing in my phpinfo() output "Core" that lists "gd"

PHP Version 5.2.4 on AWS.

12 Answers

if you are on a Debian based server (such as Ubuntu) you can run the following command:

apt-get install php-gd

Then once it is complete run:

/etc/init.d/apache2 restart

This will restart your server and enable GD in PHP.

If you are on another type of system you will need to use something else (like yum install) or compile directly into PHP.

PHP7 Or PHP8 For Windows:

Check if in your php.ini file has the following line:

;extension=gd

if exists, change it to

extension=gd

if not found, Add this

extension=gd

and restart apache

(it works on WINDOWS)

For php7.1 do:

sudo apt-get install php7.1-gd

and restart webserver. For apache do

sudo service apache2 restart

If You're using php5.6 and Ubuntu 18.04 Then run these two commands in your terminal your errors will be solved definitely.

sudo apt-get install php5.6-gd

then restart your apache server by this command.

 sudo service apache2 restart

I've PHP 7.3 and Nginx 1.14 on Ubuntu 18.

# it installs php7.3-gd for the moment
# and restarts PHP 7.3 FastCGI Process Manager: php-fpm7.3.
sudo apt-get install php-gd

# after I've restarted Nginx
sudo /etc/init.d/nginx restart

Works!

Enable gd via XAMPP in windows

First stop the server and go to config

enter image description here

Find the ;extension=gd

enter image description here

Remove the ; and save

enter image description here

and start the server then you will fixed the issue.

in my case:

I am using PHP 8 I had to search for ;extension=gd in my php.ini file. Then removed the ; and error has gone.

Related