How to add GD 2 support to PHP

Found that howto on rasmus\’ page [1]:

GD-2.0.1 and PHP

0. Make sure you have libjpeg and libpng installed
1. Grab GD-2.0.1 from [2]
2. tar zxvf gd-2.0.1.tar.gz
3. cd gd-2.0.1
4. Edit the Makefile and change the LIBS line to be:
LIBS=libgd.a -lpng -lz -ljpeg -lfreetype -lm
5. make libgd.a (don\’t need to do a make install)
6. Now build PHP using these flags:
–with-gd=/home/<you>/gd-2.0.1
–with-freetype-dir=/usr
–enable-gd-native-ttf (for PHP 4.0.6 leave off trailing \’f\’)
–enable-gd-imgstrttf
–with-jpeg-dir=/usr
–with-png-dir=/usr
–with-zlib

[1] http://www.php.net/~rasmus/gd.html
[2] http://www.boutell.com/gd/http/gd-2.0.1.tar.gz

Leave a Reply