Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to install PHP 5.2.17 on CentOS 6.2. I have downloaded RPMs from

Problem is that the PHP RPM seems to have GD disabled by default. Hence in spite installing php-gd RPM, GD is disabled.

Is there any way that I can enable GD. Atomicorp seems to be the only website that has PHP 5.2.17 RPMs.

I am not an advanced user to be able to compile PHP.

I would appreciate help on this.

share|improve this question
Did you enable the gd-extension after installing the GD RPM? In the php.ini file you need something like this – pkhamre Mar 30 '12 at 6:49
up vote 2 down vote accepted

As has been mentioned in a comment by pkhamre you may just need to edit php.ini and enable the gd extension. [change a line from ; to in php.ini or if that line doesn't exist add it to your php.ini]

Alternatively, if you are not looking for a specific version of PHP5, you can use a package manager. They are on most linux distro's and vary slightly from distro to distro but will take care of most of the issues involved with installing and keeping software up-to-date (important!).

On CentOS you should be able to yum install php-gd or similar.

share|improve this answer
Tried adding the line to the php.ini file. It still wouldn't work. – Pratik Thakkar Apr 2 '12 at 4:39
What does phpinfo() say about what you are running? (Create an php page with <?php phpinfo(); ?> and load up the page) Have you tried using yum ? – syserr0r Apr 2 '12 at 11:20
This is on a local server. So cannot put up a direct link. Although I have copied source and put it up on one of my sites for you to view. URL is Yum always updates PHP to 5.3 which I want to avoid. Hence am not using yum. Thanks – Pratik Thakkar Apr 3 '12 at 4:22
Run updatedb && locate from a root shell and show me what it says please. It may be that is in the wrong place (since the RPMs are packaged from different authors). According to extension_dir in your phpinfo should be in /usr/lib/php/modules. Might I ask why you don't want to run php 5.3? – syserr0r Apr 3 '12 at 15:47 is located in /usr/lib/php/modules/ Some portions of the websites running on the web server are not compatible with PHP 5.3. – Pratik Thakkar Apr 4 '12 at 5:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.