Miscellaneouss

How To Install PHP-GD On Ubuntu And Debian System

install-php-gd-on-ubuntu-debian
mm
Written by Santosh Prasad

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:

/etc/php5/cli/conf.d/20-gd.ini,
gd
GD Support => enabled
GD Version => 2.1.1-dev
gd.jpeg_ignore_warning => 0 => 0
GDM_LANG => en_US
GDMSESSION => ubuntu
_SERVER["GDM_LANG"] => en_US
_SERVER["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
<?php
 phpinfo();
?>

Save and close file.

Now open browser and access phpinfo.php page.

http://domain_name_or_IP/phpinfo.php

phpinfo-page

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

Thanks)

About the author

mm

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