How to Install PHP GD Support to Apache on Ubuntu

GD library is used to create and manipulate image file in PHP. PHP will need to be compiled with GD library for image functions to work. If you are using Apache web server and want to install PHP GD support, then this tutorial will help you a lot. Ubuntu comes with the package called php5-gd to add GD support. You need to install php5-gd to Apache for using the image functions in PHP.

Just follow the below simple steps to enable GD extension under Ubuntu 14.04.

Open the Terminal and type the following command.

sudo apt-get install php5-gd

Once the php5-gd installation is complete, restart the Apache 2 web server by entering the following command.

sudo service apache2 restart

Now verify whether PHP GD Support is enabled or not.

php -i | grep -i --color gd

You’ll see the output like the below.

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

You can also check the GD extension status using PHP script. Create a file (test.php) => place the following code in this file (test.php) => Run this file (test.php) and look for GD extension.


Related Articles

Comments 0