Enabling GD Support for PHP

Certainly! To enable GD library for PHP, follow these steps
- On Linux (Debian/Ubuntu):
- Install GD library:
sudo apt-get install php-gd
(for Debian/Ubuntu) orsudo yum install php-gd
(for CentOS/RHEL). - Edit
php.ini
by opening it with a text editor:sudo nano /etc/php/7.x/apache2/php.ini
orsudo nano /etc/php/7.x/cli/php.ini
. - Add or uncomment the line
extension=gd
(remove the semicolon if present). - Restart Apache:
sudo service apache2 restart
or Nginx:sudo service nginx restart
. - Verify GD is enabled by creating a
phpinfo.php
file with the code<?php phpinfo(); ?>
and searching for “gd” in your browser.
- Install GD library:
-
On XAMPP (Windows):
- Open
php.ini
(usually located atC:\xampp\php\php.ini
). - Search for the line with
; extension=gd
and remove the semicolon to enable GD library:extension=gd
. - Save the file.
- Restart Apache in XAMPP Control Panel.
- Verify GD is enabled by creating a
phpinfo.php
file in thehtdocs
directory (usuallyC:\xampp\htdocs\
) with the same code as above.
- Open
