Ubuntu Linux install or add php gd support to Apache
Q. I am using Apache server and PHP5. How do I install install php gd support?
A. PHP is used mainly in server-side application software along with various addons.
PHP includes a large number of free and open source libraries with the core build. PHP is a fundamentally Internet-aware system with modules built in for accessing FTP servers, many database servers, embedded SQL libraries such as embedded MySQL and SQLite, LDAP servers, and others. Many functions familiar to C programmers such as those in the stdio family are available in the standard PHP build.
The GD Graphics Library for dynamically manipulating images. You will need to compile PHP with the GD library of image functions for this to work.
However Ubuntu (and Debian) comes with package called php5-gd
Just type following command to install this module:
# apt-get install php5-gd
OR
$ sudo apt-get install php5-gd
Restart Apache
# /etc/init.d/apache2 restart
Test your php application.
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Howto rebuild Apache for Cpanel Linux / UNIX Server (Control Panel)
- How to install and start the Apache or httpd service under Linux
- Ubuntu Linux play encrypted DVDs
- Install Language support in CentOS 5 or Red Hat Enterprise Linux
- How do I find out syntax errors in my Apache web server configuration file?
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


February 7th, 2007 at 11:46 am
Thanks didnt really understand what GD was and which package it was. Apt-cache search gave me a load of weird packages. So i thank you!
Perhaps it would be nice if there was a line you can run to see if its running properly
February 7th, 2007 at 3:15 pm
Heroin,
You can type php -m command to see php-gd support is loaded or not at a shell prompt:
php -mYou can also create a php code with phpinfo() function and see if GD is loaded or not
<?php
phpinfo();
?>
February 14th, 2007 at 8:22 am
That’s great, it solves my problem in my new server. Good stuff.
April 4th, 2007 at 7:26 am
when running in a browser it only shows the code, but doesn’t show the php information.
Can anyone please help me solving this problem.
April 4th, 2007 at 10:36 am
I have a problem running php files in a browser; I tried a test.php with but it only shows the code lines in the browser with no PHP information.
I would really appreicate you help.
July 4th, 2007 at 3:29 pm
Hi, I want to install GD library, I want use it with PHP
I tried:
sudo apt-get install php5-gd
but i get following error message
E: couldn“t find package php5-gd
Apache is working, my soft versions are:
SO ubuntu 7.07
PHP Version 5.2.1
Apache/2.2.3 (Ubuntu)
what can I do?
THANKS!!!
July 5th, 2007 at 12:26 pm
You need to use php5-gd only, try apt-get update first.
July 17th, 2007 at 9:25 pm
When I apt-get install php5-gd the response is ‘Please insert the disc labeled ‘Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386′.
But I am working remote, what can I do to solve this issue??
July 17th, 2007 at 9:47 pm
You need to force apt-get to run via network by editing /etc/apt/sources.list file. Comment out CDROM entry.
July 17th, 2007 at 10:08 pm
@vivek.
Thanks that did the job!
I had to apt-get update first and after that it worked like a charme!
Thanx again
November 9th, 2007 at 8:08 am
Thanks, My prob Solved.
November 10th, 2007 at 9:46 pm
I have a standard linux box from theplanet.com (formerly ev1servers.net formerly rackshack.net) and they generally use Redhat Pro as the OS..
I found the easiest way to install PHP GD on the servers from “the planet” was to use the command:
yum install php-gd
Do it from the root dir via SSH (using the program called “putty”) and it all happens very fast. Restart the server and check if your page apps run correctly.
Thats about as simple as I can explain it for any other newbies that don’t understand linux like myself.
hope this is helpful.
December 5th, 2007 at 3:49 pm
Hi all,
I’m running a Joomla install on a virtual Jumpbox. I’ve tried running the above but it doesn’t seem to help.
Has anyone experience of getting this to work on the Jumpbox platform?
Cheers, MARK.
February 28th, 2008 at 10:02 am
thank you =)
April 26th, 2008 at 6:58 am
thank you