How to enable GD library support in PHP

Source: Internet
Author: User
: This article mainly introduces how to enable GD library support in PHP. For more information about PHP tutorials, see. How to enable GD library support in PHP
Enable GD library support for PHP in Linux
# The following methods are supported to enable the GD Library:
# Check whether the GD Library has the Installation Command
Php5-m | grep-I gd
Or
Php-I | grep-I -- color gd
# If the GD library is not installed, install it on the server as follows:
### If the installation is source code, add the parameter
-- With-gd
### If it is a debian linux system, use apt-get to install it, as shown below:
Apt-get install php5-gd
### If it is a CentOS system, install it using yum, as shown below:
Yum install php-gd
### If the suse linux system is used, install it using yast, as shown below:
Yast-I php5_gd
### If this world is not enough, you can add
First, go to the zlib source code, libpng source code, and gd source code.
Decompress the package to the source code directory.
Zlib Directory
./Configure -- prefix =/usr/local/zlib
Make; make install
Make clean
Libpng Directory
Cp scripts/makefile. linux./makefile
./Configure -- prefix =/usr/local/libpng
Make; make install
Make clean
Gd Directory
./Configure -- prefix =/usr/local/libgd -- with-png =/usr/local/libpng
Make; make install
Make clean
Finally, find [gd] in php. ini and add a line below.
Extension =/usr/local/libgdgd. so
Restart the php service. if not, try reboot.
Okay, but I 'd like to remind you that there are many surprises in the world. for source code installation, only the gd Library is added. in this case, the PHP version and library version are different, so:
-There is no guarantee that there will be a return if you pay so much.
-It is not guaranteed that gd. so can be loaded successfully.
-No pregnancy is guaranteed
Therefore, if the source code is used for installation, it is best to add the parameter -- with-gd when compiling PHP.
Enable GD library support for PHP in Windows
Find php. ini, open the content, and find:
; Extension = php_gd2.dll
Remove the semicolon ";" at the beginning and save it. if there is no semicolon, it is enabled.

The above describes how to enable GD library support in PHP, including some content, and hope to be helpful to friends who are interested in PHP tutorials.

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.