How to Install PHP GD Support on Windows Server

The GD library is required to create and manipulate images in PHP. You need to enable GD library support for working with image functions in PHP. Here we’ll show you how to install GD library in PHP on Windows server.

In order to install PHP GD support on Windows server, follow the below steps.

  • At first make sure the php_gd2.dll file is exists in extensions directory of PHP folder.
  • If php_gd2.dll file is not present in extensions directory, download it from here and insert the php_gd2.dll file to the extensions directory.
  • Open the php.ini file in a text editor and check whether the php_gd2.dll extension has already been added. (;extension=php_gd2.dll)
  • If ;extension=php_gd2.dll is exists in php.ini file, enable GD extension by uncommenting the extension=php_gd2.dll line. Uncomment can be done by deleting the leading ; from the extension.
    // change the following line from ...
    ;extension=php_gd2.dll
    
    // ... to
    extension=php_gd2.dll
    
  • To include php_gd2.dll as an extension, add the following line in php.ini.
    extension=php_gd2.dll
    
  • Restart the Windows server.

If your server uses PHP 8.x, you just need to uncomment the following line in the php.ini file to enable GD extension.

extension=gd

Use the phpinfo() method to check whether the GD library is installed in the PHP server. It will display information about the PHP’s configuration. Search for GD Support, you’ll see the information about the GD configuration.

<?php phpinfo(); ?>

Follow the same steps mentioned above to install the PHP GD library in XAMPP or WAMP localhost server.

5 Comments

  1. Mart Burg Said...
  2. Abhishek Singh Said...
  3. Seetharaman Said...
  4. Nathon Said...
  5. Nazrul Isalm Said...

Leave a reply

keyboard_double_arrow_up