How to install or add PHP GD support in Ubuntu

PHP is mainly a server side language which renders the code at server and throws the output to the client end through Apache or any other HTTP server. So, being a newbie we often suffer from GD support in Ubuntu. This are the following steps to install or add PHP GD support in Ubuntu.

$ apt-get install php5-gd
OR
$ sudo apt-get install php5-gd
$ /etc/init.d/apache2 restart

Now PHP GD support is ready to work.

5 Comments

Ron Identicon Icon Ron  on November 22nd, 2008

Thanks for the article Mishu bhai :) is it possible for you to write another tutorial on how to install/add support php gd in linux enterprise edition.

syok Identicon Icon syok  on February 28th, 2009

My server is not connected to internet. and apt-get is not the way. how do i install gd library if my server is not connected to internet?
tq

Saifur Identicon Icon Saifur  on March 3rd, 2009

@syok, you can download the package manually and then configure your PHP.

aballeras Identicon Icon aballeras  on June 4th, 2009

hi saifur. your article is a great help. thanks alot.

cbemerine Identicon Icon cbemerine  on September 14th, 2009

For some reason the package would not install on my ubuntu 8.10 server. When I used sudo apt-get install php5-gd. So I became the superuser sudo -i and ran

apt-get install php5-gd
/etc/init.d/apache2 restart

And it worked. Just FYI

Leave a Comment