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)"!