phil has a blog - Install GD Library on Leopard in 5 easy steps

Install GD Library on Leopard in 5 easy steps

1. Download PHP 5.2.5 (beta6 or newer) and unpack

curl -O http://www2.entropy.ch/download/php5-5.2.5-6-beta.tar.gz
tar -xzf php5-*-beta.tar.gz

2. Move the extracted php5 folder into /usr/local

sudo mv php5 /usr/local/

3. Change the owner to root

sudo chown -R root:admin /usr/local/php5

4. Open httpd.conf and comment out the existing LoadModule line if you are already using the default php5 and add the following line to set the new path of the module.

#LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php5_module local/php5/libphp5.so

5. Copy your existing php.ini into the new location

sudo cp /etc/php.ini /usr/local/php5/lib

Restart Apache and you now have GD support.