How To Install PHP-GD On Ubuntu And Debian System

GD library is used to manipulate image file in PHP. You will need to install GD library for image functions to work. If you are using Apache web server with PHP 5 server side scripting language to create dynamic web pages for your website. Then this tutorial will help you a lot.

In this tutorial I will describe how you can install php5-gd on Ubuntu and Debian system.

Installing PHP-GD

Follow the below simple steps to enable GD extension on Ubuntu and Debian system.

$ sudo apt-get install php5-gd

After installation is complete, restart the Apache web server using below command.

$ sudo service apache2 restart

Now verify the PHP GD support is enabled or not using below command.

$ php -i | grep -i --color gd

You will get some output like below:

GD Support => enabled
GD Version => 2.1.1-dev
gd.jpeg_ignore_warning => 0 => 0
GDMSESSION => ubuntu

You can also check GD extension is enable or not using phpinfo.php page. You will need to create a phpinfo.php with below code.

$ vim phpinfo.php

Save and close file.

Now open browser and access phpinfo.php page.



I hope this article will help to enable PHP GD on Ubuntu and Debian system.


Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at Look Linux Submit Article. Stay connected to Facebook.

About the author


Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment