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.iniby opening it with a text editor:sudo nano /etc/php/7.x/apache2/php.iniorsudo 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 restartor Nginx:sudo service nginx restart. - Verify GD is enabled by creating a
phpinfo.phpfile 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=gdand 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.phpfile in thehtdocsdirectory (usuallyC:\xampp\htdocs\) with the same code as above.
- Open
