What is the GD library? Specific introduction to loading the GD library in PHP

Source: Internet
Author: User
Tags php development environment phpinfo
What is the GD library? Specific introduction to loading the GD library in PHP

What is the GD library?

First we want to introduce what is the GD library: GD library, is the PHP processing graphics extension Library, GD library provides a series of APIs for processing pictures, using the GD library can process pictures, or create images, GD library is an open, dynamic creation of images, the source code public Library of functions, which can be downloaded from the official website. At present, the GD library supports GIF, PNG, JPEG, WBMP and XBM, and many other image formats for image processing!

GD Library is installed in PHP5 Chinese by default, but to activate the GD library. The php.ini file must be set, that is, the "; extension = php_gd2.dll" option in the file before the semicolon ";" is removed. Then save the modified file and restart the Apache server to take effect!

After successfully loading the GD2 function library, you can obtain the installation information of the GD2 function library through the phpinfo () function, verify that the GD library is installed successfully, check the page for GD support, and if not, you need to install additional extensions.

There are two ways to verify the GD library, the first is to create a PHP file, and then output phpinfo () directly, the code is as follows:

<?phpheader ("content-type:text/html; Charset=utf-8 ");p hpinfo ();? >

The second method is to enter "127.0.0.1/phpinfo.php" in the address bar of the browser and press ENTER, the first and second methods get the same results, and then open the page if you retrieve the GD library installation information, that is, the installation of the GD library was successful! Such as:

Description

1. If you are using an integrated installation package to configure the PHP development environment, do not worry about this, because in the integrated installation package, the default GD2 library has been loaded.

The GD library can be used under both 2.Linux and Windows systems, and the functions are exactly the same, but the coordinates of the graphs are offset. If the two systems are ported to each other, then the interface must be re-viewed.

Loading the GD library in PHP we introduced here, the next we will introduce the application of graphic image, please read the "Create image and color and fill the background of the detailed (PHP graphic image of the typical application tutorial 1)"!

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.