PHP 最全编译安装 gd 库
安装gd依赖库
freetype
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.gz
tar jxvf freetype-2.4.0.tar.gz
cd freetype-2.4.0
./configure --prefix=/usr/local/freetype
make && make install
jpegsrc
wget http://www.ijg.org/files/jpegsrc.v9.tar.gz
tar -zxvf jpegsrc.v9.tar.gz
cd jpeg-9
./configure --prefix=/usr/local/jpeg
make && make install
libpng
wget http://jaist.dl.sourceforge.net/project/libpng/libpng12/1.2.56/libpng-1.2.56.tar.gz
tar -zxvf libpng-1.2.56.tar.gz
cd libpng-1.2.56
./configure --prefix=/usr/local/libpng
make && make install
安装 gd 库
cd /path/php-5.6.25
cd ext/gd
/usr/local/php/bin/phpize
./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
make && make install
其中with-php-config 为PHP相关目录 with-jpeg-dir with-png-dir with-freetype 分别与上面的configure 指定的prefix 安装路径保持一致