Home > Article > Backend Development > Whether php enables gd
What is the GD library used for? It 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. The GD library is not enabled by default in PHP. If you want it to support image processing functions, you must manually enable the GD library
##How to open the GD library
In php.ini, remove the previous; in extension=php_gd2.dll. (Recommended learning:PHP programming from entry to proficiency)
When opening the gd library of php on the windows server, gd does not appear in the Configure Command in the results obtained by phpinfo() after using cgi .Find extension=php_gd2.dll in the php.ini file and remove the previous;.The method to detect whether the GD library has been installed, the code is as follows:
<?php if(extension_loaded('gd')){ echo '可以使用gd<br>'; foreach(gd_info() as $cate=>$value){ echo "$cate:$value<br>"; } } else{ echo '没有安装gd扩展'; } ?>
The result is as follows:
It means the activation is successful~~~
The above is the detailed content of Whether php enables gd. For more information, please follow other related articles on the PHP Chinese website!