Home  >  Article  >  Backend Development  >  Whether php enables gd

Whether php enables gd

(*-*)浩
(*-*)浩Original
2019-09-27 09:21:272894browse

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

Whether php enables gd

##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(&#39;gd&#39;)){
        echo &#39;可以使用gd<br>&#39;;
        foreach(gd_info() as $cate=>$value){
            echo "$cate:$value<br>";
        }
    }
    else{
        echo &#39;没有安装gd扩展&#39;;
    }
?>

The result is as follows:

Whether php enables gd

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn