Enabling PHP extensions - gd_info()

I have understood that if I want to use for example the function gd_info() in PHP I have to enable some extensions. I am using Debian, but I havent found any how to or source anywhere that shows how to do it. Some one have any tips in here?
Who is Participating?
PhatzerConnect With a Mentor Commented:

I'm running an Ubuntu server, which is built on Debian (as is my understanding), so I hope I can help you out a little here.

First of all, the path to my PHP configuration file is here:

Now, to enable GD library, which I'm guessing you want to do, there is an available Debian package. Under Ubuntu I'd use 'sudo apt-get install php5-gd', however I believe you'd need to run the following:

sudo aptitude install php5-gd

Now if this is like the apt-get installations, it'll confirm one or two bits and install the package.

Providing that's all successful, you'll need to restart apache, which I'd suggest you do this way:

sudo /etc/init.d/apache2 restart

You should find then the GD library is installed, however to double check, make a php file on your /var/www (or whatever your web root it) as mentioned above with:


In there, you should have a group of settings about half way down, with the heading 'gd', if it's there, success :)

Best of luck!
You'll need to find the php.ini in use on your system.  Inside your php.ini file, you'll find and extensions section.  Uncomment the line for the gd which should be:

Change it to:


You may need to restart apache:  /etc/init.d/./.httpd restart

Most likely your php.ini will be in /etc.  If you are unsure, create a file called phpinfo.php in the root of your web directory (/var/www/html typically) and put this in it:


Then load the page your browser.  There will be a line at the top that shows which php.ini file you are using.
itniflAuthor Commented:
LinuxNubb showed the right direction, but Phatzer showed the whole way. Thanks! It worked like a dream :)
Good to hear it worked :)
All Courses

From novice to tech pro — start learning today.