GD Library Install

Coppermine as well as various other applications require that the GD library be included in PHP.

Under Unix, the normal PHP build option is --with-gd, which will cause the built-in version of GD to be used. However, the later versions of this library support both png and gif files so download the tar file from http://www.libgd.org/ and untar it in the top level source directory (e.g. /rpm/GD):

     tar -xvzf gd-a.b.yy.tar.gz

Check out the README.TXT file for a list of prerequisites for the GD library. If you don't already have them, download and install them (at least zlib, libpng, freetype and the jpeg library are recommended).

  1. zlib, available from http://www.gzip.org/zlib/ Data compression library
       ./configure --prefix=/usr --shared
     2) libpng, available from http://www.libpng.org/pub/png/
        Portable Network Graphics library; requires zlib
       ./configure --prefix=/usr
     3) FreeType 2.x, available from http://www.freetype.org/
        Free, high-quality, and portable font engine
     4) JPEG library, available from http://www.ijg.org/
        Portable JPEG compression/decompression library
       ./configure --prefix=/usr --enable-shared --enable-static

All of these libraries are built with the standard "./configure", "make", "make install" sequence, as shown below. To build and install them in the system's library directory (i.e. /usr/lib), you should use the configure command shown, as follows:

     ./configure ...
     make
     make install

For the JPEG library, you may need to create the /usr/man directory structure on some systems to hold the man pages. The directories required are "man1", "man5" and "man8". Their permissions should be set the same as the standard man directories (e.g. /usr/share/man/manx).

If you do not have a version of autoconf later than 2.54, you will need to get the latest version from GNU (http://ftp.gnu.org/gnu/autoconf/) and install it with the usual "./configure", "make", "make install" sequence.

Once you have all of these prerequisites installed, switch to the newly created directory for your version of GD and build libgd:

     cd gd-a.b.yy
     ./configure --prefix=/usr
     make

Switch to super-duper user and install libgd:

     su
     make install

Under Windoze, GD is included in the PHP distribution but it is usually not enabled. Find the php_gd2.dll in your distribution directory and copy it to either your extensions directory, the bin directory or the Apache bin directory.