GD Library is a widely used PHP extension for image processing, enabling functionalities like creating, resizing, and manipulating images dynamically. Many PHP applications, including CMS platforms like WordPress, Joomla, and custom web apps, require GD Library support. This guide will walk you through enabling GD Library for PHP on a Windows server running IIS.
To enable GD Library support for PHP on a Windows server, follow the steps below:
Step 1: First of all, make sure that the php_gd2.dll or php_gd.dll file is present in the directory identified as the extension directory in the PHP folder.
C:\Program Files\PHP\ext

Step 2: If the above file is not present, you need to download it from https://www.php.net/ extract the content from the .zip file, and copy it to the extension directory of the PHP folder.

Step 3: If the file is already present, then you need to enable the php_gd2.dll or php_gd.dll extension from the php.ini configuration file and ensure the following line is uncommented (remove the semicolon if present):
extension=php_gd2.dll or extension=gd

Step 4: You can verify the extension directory through the PHPINFO page. Following is the code for the PHPINFO Page:
# <?php
phpinfo();
?>
Access this file via your browser (e.g., http://yourdomain.com/phpinfo.php) and look for the GD section to confirm it is enabled.

Step 5: After performing all these steps, restart the IIS web server.
# iisreset
Conclusion:
Enabling GD Library support ensures that your PHP applications can perform image processing tasks correctly. After following these steps, your Windows server will have GD Library enabled, and you can verify it using the PHPINFO page. Always remember to restart IIS after making changes to the php.ini file.
