首页 > 代码库 > PHP 编译安装 gd 库

PHP 编译安装 gd 库

作者博文地址:https://www.cnblogs.com/liu-shuai/

安装gd依赖库

  freetype

1 wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.gz
2 
3 tar jxvf freetype-2.4.0.tar.gz
4 
5 cd freetype-2.4.0
6 
7 ./configure --prefix=/usr/local/freetype
8
9 make && make install

  jpegsrc

1 wget "http://www.ijg.org/files/jpegsrc.v9.tar.gz" 
2 
3 tar zxvf jpegsrc.v9.tar.gz
4 
5 cd jpeg-9
6 
7 ./configure --prefix=/usr/local/jpeg 
8 
9 make && make install

  libpng

1 wget http://jaist.dl.sourceforge.net/project/libpng/libpng12/1.2.56/libpng-1.2.56.tar.gz 
2 
3 tar zxvf libpng-1.2.56.tar.gz
4 
5 cd libpng-1.2.56
6 
7 ./configure --prefix=/usr/local/libpng
8 
9 make && make install

安装 gd 库

1 cd /path/php-5.6.25
2 
3 cd ext/gd
4 
5 /usr/local/php/bin/phpize
6 
7 ./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
8 
9 make && make install

 

PHP 编译安装 gd 库