How PHP Opens the GD library in the Windows environment

Source: Internet
Author: User
Tags mssql

One, what is the GD library?

GD Library is a php processing graphics extension Library, GD library provides a series of APIs for processing pictures, using the GD library can process pictures, or create pictures, you can also add watermarks to the picture. The GD library on the website is usually used to generate thumbnails, or to add watermarks to images, or to generate Chinese character verification codes, or to generate reports on site data. In PHP processing images, you can use the GD library, and the GD library started with GIF support, but because GIF uses a copyright dispute LZW algorithm, will cause legal problems, so from the GD Library 1.6 version of all the GIF support removed, but also in the GD library 2.0.28 version and added back. If you use a version of GD library between the two, the GIF correlation function is not available.

This article introduces, under Windows to open the PHP GD library method, the GD library in PHP default is not open, if you want it to support image processing function, must be manually opened.

Second, the way to open the GD library

Remove the Extension=php_gd2.dll from the front in the php.ini;

When the Windows Server opens the PHP GD library, the results of phpinfo () after using CGI do not appear gd in the Configure Command.

Locate the php.ini file Extension=php_gd2.dll remove the front;

To detect if you have installed the GD library method, the code is as follows:

1<?PHP2     if(extension_loaded(' GD ')){3         Echo' Can use gd<br> ';4         foreach(Gd_info () as $cate=$value){5             Echo"$cate:$value<br> ";6         }7     }8     Else{9         Echo' GD extension not installed ';Ten     } One?>

The results are as follows:

The instructions are successful! ~ ~

If there is a problem, Configure Command displays:

1 Cscript/nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "-- Without-pdo-mssql ""--without-pi3web ""--with-pdo-oci=c:php-sdkoracleinstantclient10sdk,shared ""--with-oci8=C: Php-sdkoracleinstantclient10sdk,shared ""--with-oci8-11g=c:php-sdkoracleinstantclient11sdk,shared ""-- Enable-object-out-dir=. /obj/""--enable-com-dotnet=shared ""--with-mcrypt=static ""--disable-static-analyze ""--with-pgo "

Possible causes:
1, permissions issues;
2, dual channel whether there is a problem, or whether the hardware is loose and so on.

How PHP Opens the GD library in the Windows environment

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.