PHP5 GD Bundled Support Fix

When Installing Open Atrium or Drupal sometimes noification show up this :

GD Image Filtering Low Quaity/Poor Performance
GD Image Rotation Low Quaity/Poor Performance

GD Library rotate and desaturate effects

It’s not such a big deal but anyway cant stand it I want everything looking green πŸ˜›
What we have to do is recompile php5 with bundled support for GD

Lets Start:

Install these: build tools, debian helpers and fakeroot

$ apt-get install build-essential debhelper fakeroot

Go to /usr/src :

$ cd /usr/src

Download PHP source

$ apt-get source php5

Install PHP5 packages

$ apt-get build-dep php5
$ cd php5-5.2.6.dfsg.1/
$ cd debian/
$ sudo nano rules

find line:

--with-gd=shared,/usr --enable-gd-native-ttf \

replace it with:

--with-gd=shared --enable-gd-native-ttf \

Go back:

$ cd ..

Now this will take some minutes while it compiles…
Build php5 packages, remember you should be in /usr/src/hp5-5.2.6.dfsg.1/ directory otherwise it will say an error.

$ dpkg-buildpackage -rfakeroot

Note: If it shows up error for the reason of language(locales)
configure locales with en_US.UTF-8 by typing:

$ dpkg-reconfigure locales

When finished go to /usr/src:

$ cd ..

Install the new php5-gd package:

$ dpkg -i php5-gd_5.2.6.dfsg.1-1+lenny9_amd64.deb

Note:depends on cpu structure, anyway, its the file that starts with php5-gd_5.2.6…..

Now restart your Apache server and you’re good to go:

$ sudo /etc/init.d/apache2 restart

Hope it helped πŸ™‚

One thought on “PHP5 GD Bundled Support Fix

  1. I have the same problem with gd. I can’t access the php files because I uploaded my website on my webserver and access is denied to me.

    The REAL problem is that none of the images on the website are shown, which is weird because I uploade THE SAME website on another webserver and although the same GD problem exists but the images are all shown!

    I am on windows 7, using drupal 7, my webhost doesnt let me modify the php files (I have so few priviliges).


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s