Check if PHP GD Library is Installed on Your Web Server

Many web scripts and web based software that are related to image generation and manipulation, depend upon the PHP GD library to work. PHP GD is the standard image processing library in php. For instance, WordPress will not be able to resize images to create thumbnails if PHP GD is not installed on your web server.

Thus, before you use any web based software that needs PHP GD support, you should conform if its installed on your web server or not. Its very easy to conform if GD library is installed or not. Here are two ways to check.

• Create a plain text file using notepad, and name it test.php. Put this code in it,

<?php phpinfo(); ?>

Upload it to the root directory of your website and then access it via browser, like this:

http://www.yoursite.com/test.php

It will display all the information about PHP installed on your web server. Scroll down a bit to find if PHP GD is enabled.

check-php-gd-library-installed-or-not

• Another way to check if PHP GD is installed on your web server is via code. Just like above, create a plain text file and put the following code in it and save it as testgd.php,

<?php
if (extension_loaded('gd') && function_exists('gd_info')) {
    echo "PHP GD library is installed on your web server";
}
else {
    echo "PHP GD library is NOT installed on your web server";
}
?>

Again, upload it to the main directory of your website and access it via browser, like this:

http://www.yoursite.com/testgd.php

If the PHP GD library is installed on your web server, it will echo PHP GD library is installed on your web server, and if its not, then it will display, PHP GD library is NOT installed on your web server.

Comments

  1. Kave says

    Thank you so much, this fixed the problem I had with thumbnails not working in a WordPress Theme From Elegant Themes.

Leave a Reply

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