Open PHP GD library support under Linux

Source: Internet
Author: User
    1. php5-m | Grep-i GD
    2. Or
    3. Php-i | Grep-i--color GD
Copy Code

2, if the GD library is not installed, the server installation, the method is as follows

    1. # If the source is installed, add the parameter
    2. --with-gd
    3. # if it's a Debian Linux system, install it with Apt-get, as follows
    4. Apt-get Install PHP5-GD
    5. # if it's a centos system, install it with Yum, as follows
    6. Yum Install PHP-GD
    7. # if it is a Linux system from SuSE, install it with YaST as follows
    8. Yast-i PHP5_GD
Copy Code

3, can be compiled in the original PHP does not support the case of GD with the first zlib source code, libpng source, GD source code extracted to the source directory zlib directory

    1. ./configure--prefix=/usr/local/zlib
    2. make; Make install
    3. Make clean
Copy Code

Libpng Directory

    1. CP Scripts/makefile.linux./makefile
    2. ./configure--prefix=/usr/local/libpng
    3. make; Make install
    4. Make clean
    5. # GD Directory
    6. ./configure--PREFIX=/USR/LOCAL/LIBGD--with-png=/usr/local/libpng
    7. make; Make install
    8. Make clean
Copy Code

Finally in the php.ini, after searching [GD], add a line below

    1. Extension=/usr/local/libgdgd.so
Copy Code

Then restart the PHP service, if not, then try to reboot, there should be no problem.

Problem Analysis: Source installation, only add GD library in this case, the PHP version and the version of the library are different, so:-not guaranteed to pay so much after the return-not guaranteed to successfully load gd.so-not guaranteed not pregnant therefore, if the source is installed, it is best to compile PHP with parameters--WITH-GD

In addition, under windows open the PHP GD library support, the operation method is as follows: Find php.ini, open content, find:

    1. ; Extension=php_gd2.dll
Copy Code

Put the front of the semicolon ";" Remove, and then save, if there is no semicolon, it is open.

>>> Further reading: PHP GD library upload images and create thumbnails of code PHP GD library generated Verification code example PHP GD library Chinese garbled Solution PHP Verification code (GD Library Generation Verification Code) examples of PHP open Gd2 extension method introduction Linux under Installation PHP GD Support Library method PHP GD library Drawing Instance code of 24 hour histogram PHP GD library dynamic Generation Line chart Instance code PHP thumbnail generation class (support ImageMagick and GD library)

  • Related Article

    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.