Solved

Enabling PHP extensions - gd_info()

Posted on 2009-04-10
4
1,027 Views
Last Modified: 2013-12-13
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?
0
Comment
Question by:itnifl
  • 2
4 Comments
 
LVL 9

Expert Comment

by:LinuxNubb
Comment Utility
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:
;extension=php_gd2.dll

Change it to:

extension=php_gd2.dll

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:

<?php
phpinfo();
?>

Then load the page your browser.  There will be a line at the top that shows which php.ini file you are using.
0
 
LVL 10

Accepted Solution

by:
Phatzer earned 250 total points
Comment Utility
Hi,

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:
/etc/php5/apache2/php.ini

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:

<?php
phpinfo();
?>

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!
0
 
LVL 2

Author Closing Comment

by:itnifl
Comment Utility
LinuxNubb showed the right direction, but Phatzer showed the whole way. Thanks! It worked like a dream :)
0
 
LVL 10

Expert Comment

by:Phatzer
Comment Utility
Good to hear it worked :)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PHP and Soap 3 25
MySQL database data submission 7 37
how can I dected if URL has variable? 7 19
session dropped in IE 10 18
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now