Using GD2 Library to create graphics in PHP does not show up in the browser
I just learned PHP soon, when using the GD2 library to create images in the browser to display the image, only a logo representing the image, my code is as follows:
Header ("Content-type:image/gif");
$image = Imagecreate (300,80);
$BG = Imagecolorallocate ($image, 220, 40, 120);
Imagegif ($image);
?>
Should be no problem, in addition to my BOM head have been removed, but it is not shown, you are asked to guide the hero Ah! Thank you!
------Solution--------------------
The code is no problem. Check your environment. Turn on the error prompt function to see.
------Solution--------------------
Well, it should be the environmental building problem! Go directly to download a wamp and then open the GD2 extension to see it!
------Solution--------------------
to other computers with the same environment, the same code, certainly can
------Solution--------------------
Try the code can--(just display a logo in the upper left corner of the image) to change the browser to see ...
------Solution--------------------
In fact, the GD library is not functioning properly. Change to a PHP version
Reference:
It is useless to change the browser, or display the image, and
if (! function_exists ("Imagecreat"))
echo "GD support not Installed";
Else
if (! function_exists ("Imagecreattruecolor"))
echo "is GD2 installed";
?> This code after execution is output "GD support not Installed", but my phpinfo () shows that there are ...