PDA

View Full Version : GD from PHP


Phil.Pierotti
04-10-2003, 08:13 AM
Checking the PHP info(), it appears that PHP is compiled with support for GD.

[or am I reading this wrong, and the entry --with-gd=shared,/usr' ' means "compiled without GD"]

However, when I run the following example script (from the PHP manual) to test GD functionality, it dies trying to ImageCreate. :confused:

Any help would be appreciated.


header ("Content-type: image/png");
$im = @imagecreate (50, 100)
or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
imagestring ($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng ($im);

rbirdman
10-10-2003, 07:49 PM
try taking the @ out of the imagecreate and see what error message you get

the Sydney PHP group (http://sydney.ug.php.net/phpBB2/index.php) are setting up a forum. someone there might be able to help.
i've not used PHP to create images myself

rbirdman
10-10-2003, 07:53 PM
just looked up a reference book.
looks like the functions need to be caps

ie ImageCreate

rather than imagecreate

Phil.Pierotti
11-10-2003, 11:37 AM
Thanks for the helpful replies, but as it turns out the problem was simply "gd support not installed". (it got followed up in another thread)

Being a Debian deployment, our helpful SysAdmin installed the package, and it works fine.