I solved this problem for debian stable (woody).
Here is my recipe:
Login on your server as root
Install the php4-gd2 liberay. You really need the GD v2 version php4-gd doesn’t work
Restart apache
Done.
So this is what you do.
>su
{type your root password}
>apt-get install php4-gd2
>apachectl graceful
>exit
The installer will ask you if you would like to add soem to a ini file just answer yes and you are fine.
Have fun