Hello!
Am I an idiot?
Cannot fix a problem with image and header functions.
I try to learn how to do images.I made a php file and copied
a simple code into it:
<?
Header("Content-Type: image/gif");
$image = ImageCreate(500, 75);
$blue = ImagecolorAllocate($image, 0, 0, 255);
ImageFill($image, 1, 1, $blue);
ImageGIF($image);
ImageDestroy($image)
?>
The browser shows strange characters, the error messages says:
fatal error: Call to undefined function: imagecreate().
I cut everything and leave only:
$blue = ImagecolorAllocate($image, 0, 0, 255);
The same message comes again-fatal error: call to undefined function:
ImagecolorAllocate...
Same happens if I only leave
ImageFill($image, 1, 1, $blue);
It appears as if not a single image function was working.
Also something wrong is with the header. The error message says:
warning: Cannot modify header information - headers already sent...
But If I comment the header, it should be a gross omission...How can an image appear if its type is not specified?
I thought maybe something was wrong with gd libraries,
so I changed gif to png, then to jpeg in above code, but it didn't help.
Other functions work ok.
My machine is Apple 400 MHz PowerPC G3, Memory 384 MB SDRAM, OS X 10.3.9.
I have PHP 5.1.2, gd 2.0.28. I use Safari.
Thank you for your help.