About Linux FAQ

Browse More FAQs:

Ubuntu Linux install or add php gd support to Apache

Posted by Vivek Gite [Last updated: December 20, 2006]

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:

Discussion on This FAQ

  1. Heroin Says:

    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

  2. nixcraft Says:

    Heroin,

    You can type php -m command to see php-gd support is loaded or not at a shell prompt:
    php -m

    You can also create a php code with phpinfo() function and see if GD is loaded or not :)

    <?php
    phpinfo();
    ?>

  3. Eric Says:

    That’s great, it solves my problem in my new server. Good stuff.

  4. zaf Says:

    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.

  5. zaf Says:

    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.

  6. cruz Says:

    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!!!

  7. vivek Says:

    You need to use php5-gd only, try apt-get update first.

  8. wilco Says:

    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??

  9. vivek Says:

    You need to force apt-get to run via network by editing /etc/apt/sources.list file. Comment out CDROM entry.

  10. wilco Says:

    @vivek.

    Thanks that did the job!
    I had to apt-get update first and after that it worked like a charme!
    Thanx again

  11. Tharange Says:

    Thanks, My prob Solved.

  12. Newbie2 Says:

    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.

  13. Mark Says:

    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.

  14. xer Says:

    thank you =)

  15. ihya Says:

    thank you

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!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.