Check whether the GD library is enabled on the server

Source: Internet
Author: User

1. Copy the following code to notepad and save it as a. php.
<? PHP
Ob_end_flush ();
Header ("Content-Type: image/PNG ");
$ Im = @ imagecreate (200,100)
Or die ("Images cannot be created ");
$ Background_color = imagecolorallocate ($ im, 0, 0 );
$ Text_color = imagecolorallocate ($ im, 230,140,150 );
Imagestring ($ im, 3, 30, 50, "www.pc811.com", $ text_color );
Imagepng ($ IM );
?>

 

2. After uploading a. php to the server space, enter the directory of the file under the website and access it successfully.

 

3. If the image is a Red Cross, the GD library is not enabled. If the GD library is not enabled, open the php. ini file and remove and save the extension = php_gd2.dll in the PHP. ini file.

 

4. After the computer is restarted, it takes effect.

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.