zlib-1.2.7/libpng-1.5.9 instead of zlib-1.2.8/libpng-1.6.6

The reason for the failure apparently appears to be version incompatibility, partly may be due to libpng-1.6.6 being unstable and has conflict with the zlib-1.2.8 being previously installed.

I uninstalled zlib-1.2.8 and reinstalled the older but stable release zlib-1.2.7 and instead of libpng-1.6.6, downloaded and installed libpng-1.5.9 and libpng installation passed the test successfully!

There was no zlib_reset - 'inflateReset2' problem this time. Don't know if there was a better solution, but I seemed to have bypassed the problem anyway. So the ideal compatible versions are zlib-1.2.7/libpng-1.5.9 instead of zlib-1.2.8/libpng-1.6.6 which I had been trying! Hope this helps.

1、

wget "http://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.bz2" 
tar jxvf freetype-2.4.0.tar.bz2
cd freetype-2.4.0
./configure --prefix=/usr/local/freetype && make && make install

2、

wget "http://www.ijg.org/files/jpegsrc.v9.tar.gz" 
tar zxvf jpegsrc.v9.tar.gz
cd jpeg-9
CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/jpeg && make && make install
mkdir -p /usr/local/jpeg/include
mkdir -p /usr/local/jpeg/lib
mkdir -p /usr/local/jpeg/bin
mkdir -p /usr/local/jpeg/man/man1

3、

  wget "http://downloads.sourceforge.net/project/libpng/libpng12/1.2.50/libpng-1.2.50.tar.gz?r=http%3A%2F%2Fwww.libpng.org%2Fpub%2Fpng%2Flibpng.html&ts=1376631135&use_mirror=nchc"  

tar zxvf libpng-1.2.50.tar.gz
cd libpng-1.2.50 
CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/libpng && make && make install


./configure --with-php-configure=/usr/local/php/bin/php-config  --with-jpeg-dir=/usr/local/jpeg  --with-png-dir=/usr/local/libpng   --with-freetype-dir=/usr/local/freetype
或者
./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

1. freetype

2tar jxvf freetype-2.4.0.tar.bz2
3cd freetype-2.4.0
4./configure --prefix=/usr/local/freetype && make && make install

2. jpegsrc

2tar zxvf jpegsrc.v9.tar.gz
3cd jpeg-9
4CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/jpeg && make && make install
5mkdir -p /usr/local/jpeg/include
6mkdir -p /usr/local/jpeg/lib
7mkdir -p /usr/local/jpeg/bin
8mkdir -p /usr/local/jpeg/man/man1

3. libpng

2tar zxvf libpng-1.2.50.tar.gz
3cd libpng-1.2.50
4CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/libpng && make && make install

接下来需要cd到php源码的 gd 目录,否则会报 cannot find config.m4 之类的错误。

1cd php-5.3.6
2cd ext
3cd gd

然后再这个目录执行命令 /usr/local/php/bin/phpize。什么时候需要用到 phpize 呢?当我们需要再加些模块,又不想重新编译php,这些我们就可以用phpize了。我的PHP安装在 /usr/local/php/ 这个目录里,可以根据个人情况修改。

1/usr/local/php/bin/phpize

现在可以进行单独编译安装了:

1./configure --with-php-configure=/usr/local/php/bin/php-config  --with-jpeg-dir=/usr/local/jpeg  --with-png-dir=/usr/local/libpng   --with-freetype-dir=/usr/local/freetype
2或者
3./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
4make && make install

接着修改php.ini文件 在 ;extension=php_zip.dll 下面添加一行 extension=gd.so

重启 Nginx 之后再看看是否安装成功了。再执行 /usr/local/php/bin/php -m 查看gd模块是否加载成功。

1service nginx restart
2/usr/local/php/bin/php -m

console列出:

01[root@nowamagic gd]# /usr/local/php/bin/php -m
02[PHP Modules]
03Core
04ctype
05date
06dom
07ereg
08fileinfo
09filter
10gd
11……

转载于:https://www.cnblogs.com/akidongzi/p/6089281.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值