How to enable php gd extension?

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.

Jonas

113k96 gold badges299 silver badges371 bronze badges

asked Feb 17, 2010 at 18:06

1

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.

answered Feb 17, 2010 at 18:51

ShaneShane

16.7k4 gold badges26 silver badges46 bronze badges

3

For PHP8 use (php8.1-gd are also available):

sudo apt-get install php8.0-gd

For PHP7.0 use (php7.1-gd, php7.2-gd, php7.3-gd andphp7.4-gd are also available):

sudo apt-get install php7.0-gd

and than restart your webserver.

sudo service nginx restart

or

sudo service httpd restart

answered May 6, 2016 at 12:41

How to enable php gd extension?

0

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

;extension=php_gd2.dll

if exists, change it to

extension=php_gd2.dll

and restart apache

(it works on MAC)

How to enable php gd extension?

Mogsdad

43.4k20 gold badges147 silver badges263 bronze badges

answered Mar 31, 2016 at 14:46

3

In my case (php 5.6, Ubuntu 14.04) the following command worked for me:

sudo apt-get install php5.6-gd

According to php version we need to change the php5.x-gd

How to enable php gd extension?

answered Jan 24, 2017 at 12:29

All previous answers are correct but were not sufficient for me on ArchLinux. I also needed to edit /etc/php/php.ini and to uncomment :

;extension=gd.so 

The initial ; on the line needs to be removed. After restarting Nginx via systemctl restart nginx, I was good to go.

How to enable php gd extension?

galoget

6759 silver badges15 bronze badges

answered Feb 16, 2017 at 10:35

2

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)

answered Aug 22, 2021 at 21:53

For php7.1 do:

sudo apt-get install php7.1-gd

and restart webserver. For apache do

sudo service apache2 restart

answered Jun 9, 2018 at 13:32

Mubashar AbbasMubashar Abbas

5,2344 gold badges36 silver badges46 bronze badges

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

answered Jun 25, 2019 at 13:13

0

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!

answered Sep 30, 2020 at 8:02

How to enable php gd extension?

Pax BeachPax Beach

1,5291 gold badge18 silver badges26 bronze badges

Enable gd via XAMPP in windows

First stop the server and go to config

How to enable php gd extension?

Find the ;extension=gd

How to enable php gd extension?

Remove the ; and save

How to enable php gd extension?

and start the server then you will fixed the issue.

answered Jul 5 at 8:42

How to enable php gd extension?

In CentOS (but the same may apply to other distros too) if you install the php7x-gd module followed by Apache restart and still the php -i does not show the GD Support => enabled it might mean that the php.ini was not automatically configured to support this extension.

All you have to to is either to edit the /etc/php/php.ini or to create a /etc/php.d/gd.ini file with the following content:

[gd]
extension=/path/to/gd.so # use the gd.so absolute path here

answered Mar 24, 2018 at 11:21

Eugen MihailescuEugen Mihailescu

3,3482 gold badges29 silver badges29 bronze badges

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.

answered Jun 8 at 12:41

Mohamed MahfouzMohamed Mahfouz

1841 gold badge4 silver badges12 bronze badges

How do I enable enable PHP's GD extension?

To install the PHP GD follow the following steps:.
Step 1: Install XAMPP in your windows system..
Step 2: Verify if GD is already installed or not. ... .
Step 3: Locate and open php. ... .
Step 4: Find ;extension=gd..
Step 5: Remove semicolon from ;extension=gd and save the file..
Step 6: Go to php folder. ... .
Step 7: Look for php_gd..

How do I fix GD library extension not available with this PHP installation?

Ten Thousand Strong.
Check your php.ini , so extension=php_gd2.dll is uncommented..
Try restarting your web server (Apache, Nginx).

How can I tell if GD is enabled in PHP?

You can check to see if the GD library is enabled by creating a simple phpinfo page on your web server..
Open your PHP. ... .
Locate the following line. ... .
Remove the preceding semicolon (;) to enable the option..
Save your file..
Restart the web server..

How do I install PHP extensions?

How To Compile And Install PHP Extensions From Source.
Install the PHP development package. On Ubuntu/debian, you can use apt-get, it's a piece of cake. ... .
Download & unzip the PHP5 source code. ... .
Prepare the extension (phpize) ... .
Configure & Make the extension. ... .
Move the extension. ... .
Edit your PHP. ... .
Restart your php..