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.
- Email FAQ to a friend
- Printable version
- Rss Feed
- Last Updated: 12-20-06
{ 19 comments… read them below or add one }
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
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();
?>
That’s great, it solves my problem in my new server. Good stuff.
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.
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.
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!!!
You need to use php5-gd only, try apt-get update first.
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??
You need to force apt-get to run via network by editing /etc/apt/sources.list file. Comment out CDROM entry.
@vivek.
Thanks that did the job!
I had to apt-get update first and after that it worked like a charme!
Thanx again
Thanks, My prob Solved.
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.
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.
thank you =)
thank you
When I tried to install some 3rd party extension in my Joomla 1.5 website (hosted on my local Ubuntu PC) I got the error that GD2 was missing.
With your instruction I was able to install GD2 successfully. I reinstalled the Joomla Extension and now it’s able to resize images!
Thanks!
I test my gd but it doesn’t support xbm ,how could i do ?
when I wanna use phpXplorer it show me could not find “PHP GD XBM Support”
thank you !
You need either PHP GD extension or Image Magick for image manipulation.
PHP GD extension found 2.0 or higher
PHP GD FreeType Support exists
PHP GD T1Lib Support exists
PHP GD GIF Read Support exists
PHP GD GIF Create Support exists
PHP GD JPG Support exists
PHP GD PNG Support exists
PHP GD WBMP Support exists
PHP GD XBM Support not found
Thanks! Never thought i could solve this problem this fast.
Thank you very much, you have resolved all my problems!