ImageMagick and GD are two different approaches on handling graphics via php (though, image magick can be used via the command-line without any php installed).
The function you were trying to use is available only when php is compiled with gd version 2 or later (the current version is 2.0.11).
You may compile php with gd but you will find that this is rather difficult (i don't really know why - i keep on trying to find answers on this issue).
Fortunately, i was lucky to find the following instructions that will help you compile php 4.2.3 (not version 4.3.0) with gd 2.0.1.
- Make sure you have libjpeg and libpng installed
- Grab GD-2.0.1.
- tar zxvf gd-2.0.1.tar.gz
- cd gd-2.0.1
- Edit the Makefile and change the LIBS line to be:
LIBS=libgd.a -lpng -lz -ljpeg -lfreetype -lm
- make libgd.a (don't need to do a make install)
- 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
I assure that the above works !!!
It will give you php with the desired gd functions.
As of ImageMagick - you can use it in conjuction with the php function "system", which allows you to execute an external program and display output, as if you were running this command from the command-line shell.
I don't know if GD can perform a task faster than ImageMagick (or the opossite). Check it, if it matters to you.