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.
php_gd2.dll
file is exists in extensions directory of PHP folder. 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.php.ini
file in a text editor and check whether the php_gd2.dll
extension has already been added. (;extension=php_gd2.dll);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
php_gd2.dll
as an extension, add the following line in php.ini
.
extension=php_gd2.dll
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.
This worked for me do keep in mind that with php 8 gd2 became deprecated and it’s just gd now.
So the extension should be extension=php_gd.dll (which was missing from my php.ini)
Thank you;
It’s working you saved my lots of time keep posting.
i also using php8.0.0 version! in php.ini file, i viewed the gd dll file! it was ready to use! but, my program contains the error of undefined function! please kindly give the proper solution to me
I have PHP8 installed on Windows 10 and there is no php_gd2.dll in the ext directory, yet it is referenced in php.ini.
Dropping php_gd2.dll into the ext directory, doesn’t resolve the matter. So confused.
In my case, I m using xampp 7.2.1. & in my php.ini
;extension=php_gd2.dll
file does not exist. there is a line
extension=gd2
and its enabled already. but still I m face problem