PHP uses the GD2 library to create graphics that are not visible in the browser

Source: Internet
Author: User
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 ...
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.