Enable PHPGD library support in Linux

Source: Internet
Author: User
Tags php introduction
Enable PHPGD library support in Linux

  1. Php5-m | grep-I gd
  2. Or
  3. Php-I | grep-I -- color gd

2. if the GD library is not installed, install it on the server as follows:

  1. # Add a parameter for source code installation
  2. -- With-gd
  3. # If it is a debian linux system, use apt-get to install it, as shown below:
  4. Apt-get install php5-gd
  5. # If it is a CentOS system, install it using yum, as shown below:
  6. Yum install php-gd
  7. # Use yast to install suse linux as follows:
  8. Yast-I php5_gd

3. you can add the zlib source code, libpng source code, and GD source code to the zlib directory when PHP does not support gd.

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

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

Finally, find [gd] in php. ini and add a line below.

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

Restart the php service. if not, try reboot.

Problem Analysis: when the source code is installed and only the gd Library is added, the PHP version and the library version are different, so: -There is no guarantee that there will be a return after so much-there is no guarantee that gd can be loaded successfully. so-it is not guaranteed that the system will not be pregnant. Therefore, if the source code is used for installation, it is best to add the parameter -- with-gd when compiling PHP.

In addition, to enable the GD library support for PHP in Windows, perform the following operations: find php. ini, open the content, and find:

  1. ; Extension = php_gd2.dll

Remove the semicolon ";" at the beginning and save it. if there is no semicolon, it indicates that it has been enabled.

>>> Extended reading: php GD Library uploads images and creates thumbnails. php GD library generates verification code instances. php GD Library contains Chinese garbled solutions. php verification code (GD library generates verification code) example: How to enable gd2 extension in php introduction how to install php GD support Library in linux php GD library example code for drawing a 24-hour bar chart php gd Library dynamic generation of line chart instance code php thumbnail generate class (supports imagemagick and gd libraries)

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.