If you're running windows, just uncomment the line ";extension=php_gd.dll" in php.ini by removing the ";" before "extension". Then restart apache. If you're running *nix, you'll have to recompile php and use the --with-gd=/path/to/gd switch.
[user@host php]$ ./configure --with-gd=/usr/local/bin/gd