0

I am trying to install PHP 5.2.17 on CentOS 6.2. I have downloaded RPMs from http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMs/

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.

Lucas Kauffman
  • 16,818
  • 9
  • 57
  • 92
Pratik Thakkar
  • 119
  • 2
  • 4
  • 1
    Did you enable the gd-extension after installing the GD RPM? In the `php.ini` file you need something like this extension=gd.so – pkhamre Mar 30 '12 at 06:49

1 Answers1

2

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 ;extension=gd.so to extension=gd.so 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.

syserr0r
  • 500
  • 3
  • 10
  • Tried adding the line `extension=gd.so` to the `php.ini` file. It still wouldn't work. – Pratik Thakkar Apr 02 '12 at 04:39
  • What does `phpinfo()` say about what you are running? (Create an php page with `` and load up the page) Have you tried using `yum` ? – syserr0r Apr 02 '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 http://www.security-list.com/notused/phpinfo.html. Yum always updates PHP to 5.3 which I want to avoid. Hence am not using yum. Thanks – Pratik Thakkar Apr 03 '12 at 04:22
  • Run `updatedb && locate gd.so` from a root shell and show me what it says please. It may be that `gd.so` is in the wrong place (since the RPMs are packaged from different authors). According to `extension_dir` in your phpinfo `gd.so` should be in `/usr/lib/php/modules`. Might I ask why you don't want to run php 5.3? – syserr0r Apr 03 '12 at 15:47
  • `gd.so` is located in `/usr/lib/php/modules/gd.so`. Some portions of the websites running on the web server are not compatible with PHP 5.3. – Pratik Thakkar Apr 04 '12 at 05:54
  • `gd.so` should be loading in that case. I believe the reason it isn't loading the `gd.so` shared library is because php was explicitly compiled `--without-gd`. – syserr0r Apr 04 '12 at 11:15
  • Is there a work around? I am not comfortable compiling PHP. – Pratik Thakkar Apr 09 '12 at 04:07
  • In a word, no. You either upgrade to 5.3 and have the 'easy' `yum install php-gd` option or you compile from source and get exactly what you want. If you are familiar with using the shell/terminal/command-line and editing text files (which you seem to be), you should be fine compiling yourself. There are plenty of guides out there that will walk you through it (__Hint__: *Look for ones specific to CentOS 6*) – syserr0r Apr 10 '12 at 09:16