: 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.