How to Install PHP GD Support on Windows Server

How to Install PHP GD Support on Windows Server

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.

To check whether GD library is installed in PHP, run the following code. 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 described above to install PHP GD library in XAMPP or WAMP server.