First, the preparatory work,
Install GD before need to install jpegsrc.v7.tar.gz, libpng-1.6.17.tar.gz, zlib-1.2.8.tar.gz, freetype-2.5.5.tar.gz
Jpegsrc.v7.tar.gz Http://pan.baidu.com/s/1c0rW9cW
Libpng-1.6.17.tar.gz Http://pan.baidu.com/s/1ntHwJ4P
Zlib-1.2.8.tar.gz Http://pan.baidu.com/s/1kTw2aQN
Freetype-2.5.5.tar.gz Http://pan.baidu.com/s/1jGGgUua
PS: These versions can also be downloaded on the official website.
It is important to note that the installation of libpng1.6
Make Prefix=/usr/local/libpng zlibinc=/usr/local/zlib/include zliblib=/usr/local/zlib/lib-f scripts/makefile.linux && make Prefix=/usr/local/libpng install-f scripts/makefile.linux (This is a statement)
Second, install the GD library
normally 5.5.13 version only support gd2.0 above version, if the use of a version of 2.0, in PHP to add the GD library when the parameter path of the GD library is not written, otherwise it will error, prompting you the GD library version is less than 2.0. The
is not compiled with CMake, so it is using the GD library 1.8 version.
./configure--prefix=/usr/local/gd--with-jpeg=/usr/local/jpeg--with-libpng=/usr/local/libpng--with-zlib =/usr/local/zlib--with-freetype=/usr/local/freetype
libgd-gd-2.1.1.tar.gz http://pan.baidu.com/s/1ntpCvup
This version of the GD library needs to be installed using CMake, so you need to download and install the build CMake
Third, PHP added to compile the GD library
Switch to PHP source package, go to "/tmp/php-5.5.13 (PHP extract directory)/ext/gd" directory, execute the following command:
/usr/local/php/bin/phpize (/usr/local/php is the path after the compilation and installation of PHP)
./configure--with-php-config=/usr/local/php/bin/php-config--with-jpeg=/usr/local/jpeg--with-png=/usr/local/ Libpng--with-freetype=/usr/local/freetype--with-zlib=/usr/local/zlib--WITH-GD=/USR/LOCAL/GD
If you are prompted that the GD library version is less than 2.0 error, the path of the GD library is not populated after--WITH-GD
If an unknown configuration entry--with-png**,--with-freetype, add the-dir parameter after the configuration entry: The Build parameter is:
./configure--with-php-config=/usr/local/php/bin/php-config--with-jpeg-dir=/usr/local/jpeg--with-png-dir=/usr/ Local/libpng--with-freetype-dir=/usr/local/freetype--with-zlib-dir=/usr/local/zlib--WITH-GD-DIR=/USR/LOCAL/GD
Make && make install
PHP Append to build GD library