Imagepng does not work: Browser says Document contains no data.
| From: | Paul Aschenborn | Date: | Sat, 21 Oct 2000 05:58:49 +0000 |
| Subject: | Imagepng does not work: Browser says Document contains no data. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-21525@lists.php.net to get a copy of this message | ||
Hello folks,
I got a problem with using the image functios of php.
I try to create a png-Image using this few lines and it fails.
Using:
php-4.0.3pl1
apche_1.3.14
gd-1.8.3
I compiled gd into php, there were no errors.
The apache logfile tells me that I accessed the file and he send 0 bytes back.
There is no comment in apache-error log about it. Then I turned php-errorlogging on, no error during
excecution of the script.
The funniest thing is, that the same script works fine on another computer with
exactly the same versions installed and compiled with the same parameters.
Does anyone of you has an idea what else I might have missed to do ?
Thanks a lot
--
<?php
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,"/tmp/img.png");
?>
--
Gruß Paul