Install PHP GD Library on Ubuntu

August 7th, 2012 by laeeq | 3 comments

PHP is not limited to creating just HTML output. you can create image files using PHP. It just needs to install GD libraray to create variety of image formats like GIF, PNG, JPEG, WBMP, and XPM. PHP output image streams directly to a browser. You will need to compile PHP with the GD library of image functions for this to work. GD and PHP may also require other libraries, depending on which image formats you want to work with.

In this post you will learn how to install PHP GD Module on Ubuntu.

Type the following command to install this module:

  1. # apt-get install php5-gd

OR

  1. $ sudo apt-get install php5-gd

Now restart your apache server

  1. # /etc/init.d/apache2 restart

Test whether php5-gd library installed or not?

Type the following command:

  1. $ php5 -m | grep -i gd

The command will return “gd”  if  GD library  installed

OR

you can test GD libraray install status by running below php code

  1. <?php
  2. echo phpinfo();
  3. ?>

Below Screen showing phpinfo() result.

You can subscribe to PHPZAG.COM posts by Email

 

Related Topics:

 

 

  1. August 14th, 2012 at 04:35 | #1

    Thanks for your post. it is really helpfull.

  2. August 17th, 2012 at 16:41 | #2

    Very good written post. It will be useful to anybody who employess it, including yours truly :) . Keep doing what you are doing – looking forward to more posts.

  3. madelinerodrsuezxo
    October 3rd, 2012 at 13:50 | #3

    you’re truly a just right webmaster. The website loading velocity is amazing. It seems that you are doing any distinctive trick. Moreover, The contents are masterpiece. you have performed a magnificent process on this matter!

  1. No trackbacks yet.