Home >Backend Development >PHP Problem >What is the php extension gd
php gd is an extension library for processing graphics in php. The GD library provides a series of APIs for processing pictures. You can use the GD library to process pictures or generate pictures.
The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer
What is the php extension gd?
GD library is an extension library for PHP to process graphics. The GD library provides a series of APIs for processing pictures. You can use the GD library to process pictures or generate pictures.
On the website, the GD library is usually used to generate thumbnails, or to add watermarks to pictures, or to generate Chinese character verification codes, or to generate reports on website data, etc. To process images in PHP, you can use the GD library. The GD library initially supported GIF. However, because GIF used the copyright-controversial LZW algorithm, it would cause legal issues, so starting from GD library version 1.6, all GIF support was moved. Except, but it was added back in GD library version 2.0.28. GIF related functions are not available when using an intermediate version of the GD library.
Installation and configuration
Edit
If it is a win server, it is relatively simple. The steps are as follows:
1. Use the dos command (you can also do it manually , copy all dll files in the dlls folder to the system32 directory) copy c:\php\dlls\*.dll c:\windows\system32\
2. Open php.ini
Set extension_dir = "c:/php/extensions/";
3. In the line ";extension=php_gd2.dll", remove the semicolon in front of extension. If there is no php_gd2.dll, php_gd.dll will also Same, make sure this file c:/php/extensions/php_gd2.dll.
Configuration method on Linux server:
yum install php-gd* #适用于32bit操作系统安装命令; yum install php-gd.x86_64 #适用于64bit操作系统安装命令;
Recommended study: "PHP Video Tutorial》
The above is the detailed content of What is the php extension gd. For more information, please follow other related articles on the PHP Chinese website!