I'm putting this in the Newbie section because it's making me feel like one... Granted, it's been a while since I've had to play with php.ini, but DANG! This is killing me. So, I think I've got the GD library placed in the right spot (I'm running php4.3.1.1 on Win2K with IIS5 as a testing server - note that this is not the system I'm actively developing on. I have the IIS set up on a separate testing system set up in my normal drag-n-drop network as drive Z:, but I'm assuming it reads itself as drive C: when looking at configuration options. Always has in the past... I think... It's been a long day so far ). The php.ini reads as such...
; Directory in which the loadable extensions (modules) reside.
extension_dir = ".;c:\PHP\extensions"
There is, in fact, an "extensions" directory in my CHP directory, and it includes php_gd2.dll, which I have also uncommented from the above quoted php.ini. Now, this should work after the server has been rebooted, I think.
And it might be. To test, I've copied the following simple script from a book that I have -
header("Content-type:image/jpeg");
$image=imagecreate(200,200);
$red=imagecolorallocate($image, 255,0,0);
imagefill($image, 0, 0, $red);
imagejpeg($image);
This comes up with the error message 'The image "http://oldsys/cga/final/www2/testing.php" cannot be displayed, because it contains errors.' So that's fun. And here's something I just figured out - I was looking at the preview of this post and realized that's not exactly how the book has it. The book calls for the "header" line right before the "imagejpeg" line, which then causes Firefox to tell me that I've called an undefined function "imagecreate". What?!?!?
Any ideas? Is this an installation or configuration error, or am I so new at image functions within php that I'm being an idiot?
Anyone? Please?