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 Comments

  1. John September 7, 2013 8:49 pm  Reply

    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!

    • ned September 14, 2013 4:51 pm  Reply

      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!

  2. Prerana Tekade September 22, 2016 11:19 pm  Reply

    My question is i enable the ge library from php.ini file…then how can i reboot the server

    • Ned November 5, 2016 6:04 pm  Reply

      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

6 + 10 =