Skip to content

Enabling GD Library in PHP.ini on Windows

By default, php comes with the GD Library package. However, it is disabled by a ‘comment out’ in the php.ini file within your server.

Most times, this doesn’t matter, and if it is required, there will be an error message telling you so.

I have personally run my server [ PHP/Apache/Windows/MySql ] without it for a while. But, if you’re running themed webpages, with everything built in and lots of image uploads, it may be required.

To do this, it’s simple, especially on a Windows install.

Simply open your php.ini file [ should be located on your server somewhere similar to c://program files/php/php.ini ] and edit the line:

;extension=php_gd2.dll

and change it to

extension=php_gd2.dll

For me, this was on line 669 of my install.

I should note that during the fresh install of PHP, using the windows installer, there is an option to enable different libraries. I have, however, had trouble in the past re-running that install (*.exe) so I choose not to re-run the install. I have also never tried enabling it upon install, maybe some of you have and it works fine?

Oh, and after this is changed, and saved, remember to restart Apache!

Good luck!

5 thoughts on “Enabling GD Library in PHP.ini on Windows”

  1. Pingback: Enabling mbstring Library in PHP.ini | Electronic Services

  2. On my php.ini the GD settings are enabled by default, but my code still does not working! I used a simple example from php.net but still it doesn’t working! Some help please!

    1. A good place to start troubleshooting John is first, make something that doesn’t use the GD library. If that works, then enable the GD library on the server. Always make sure to reboot the server after changing configurations, and then test it again. Then, there are tests that you can do to see exactly what libraries are enabled on PHP. This is accomplished by adding a simple line of code to a page that you can view online. I suggest making it a new page, and then deleting the page when you’re done, because this is information you don’t really want to show everybody – though they can get it if they try… See http://php.net/manual/en/function.phpinfo.php

      If all of this works, I’d suggest trying another theme that also uses the GD Library, to see if it’s the theme that’s incomplete.

      Good luck!

    1. Prerana, simply powering down and restarting! On a Windows computer this is done with start->restart. If you’re using a command in Ubuntu it will be sudo reboot. I suggest a simple Google search for whatever OS your server is running on to figure it out, but you can also just reboot NGINX itself. On Ubuntu this is done: sudo service nginx restart. Good luck!

Leave a Reply to Prerana Tekade Cancel reply

Your email address will not be published. Required fields are marked *

5 × 1 =