linux php支持gd库_linux环境下php GD库的安装

linux环境下php GD库的安装

1.安装zlib

tar zxvf zlib-1.2.2.tar.gz

cd zlib-1.2.2

./configure

make

make install

2.安装libpng

tar zxvf libpng-1.2.7.tar.tar

cd libpng-1.2.7

cd scripts/

mv makefile.linux ../makefile

cd ..

make

make install

注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个

3.安装freetype

tar zxvf freetype-2.1.9.tar.gz

cd freetype-2.1.9

./configure

make

make install

4.安装Jpeg

tar zxvf jpegsrc.v6b.tar.gz

cd jpeg-6b/

./configure –enable-shared

make

make test

make install

注意,这里configure一定要带–enable-shared参数,不然,不会生成共享库

5.安装GD

tar zxvf gd-2.0.33.tar.gz

cd gd-2.0.33

./configure –with-png –with-freetype –with-jpeg

make install

6.重新编译PHP

tar zxvf php-5.2.17tar.gz

cd php-5.2.17

./configure (以前的参数) –with-gd –enable-gd-native-ttf –with-zlib –with-png –with-jpeg –with-freetype –enable-sockets

make

make install

然后编辑php.ini,加入extension=gd.so

重启apache就行了

若还是不成功,那就使用终极大招,把yum源切换成阿里的,然后执行

yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt

重启apache

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值