1. Uncomment the following line in php.ini. php.ini file is located in the main directory of your PHP installation, for example: C:\PHP\php.ini.
2. Make sure you have php_gd2.dll file in the extensions directory. The extension directory of my PHP installation is C:\PHP\ext. Look for the directive “extension_dir” in php.ini file to get the exact location of your extensions directory.
3. Run php.exe from your PHP installation directory.
3.1. If you don’t have the dll file, you will have a similiar error message as below:
Unknown(): Unable to load dynamic library 'C:\PHP\ext\php_gd2.dll' - The specified module could not be found.
Download the appropriate Windows Binaries from the Official PHP Website Downloads page and copy the required extension into your php extension directory.
4. Restart Apache server.
[tags]troubleshooting, gd library, php, configuration, apache[/tags]