免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1346 | 回复: 0
打印 上一主题 下一主题

linux GD库安装 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-10 13:24 |只看该作者 |倒序浏览
GD 安裝
第一部需要做的是先要安裝 GD 到系統內,而安裝 GD 前需要安裝 jpeg-6b, libpng, zlib, freetype。以下是下载网址:
GD 2.0.33
jpeg-6b
libpng 1.2.8
zlib 1.2.3
freetype-2.1.10.tar.gz

代码:
wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz
wget ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
wget http://nchc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8-config.tar.gz
wget http://www.zlib.net/zlib-1.2.3.tar.gz
wget
http://prdownloads.sourceforge.net/freetype/freetype-2.1.10.tar.gz?download


安裝 zlib
#不要用-prefix指定安装目录会影响GD
代码:
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure  #或者 CFLAGS="-O3 -fPIC" ./configure   #如果64位处理器需要 CFLAGS="-O3 -fPIC"
make
make install
引用:
安装zlib-1.2.3.tar.gz
修改Makefile文件
找到 CFLAGS=-O3 -DUSE_MMAP
在后面加入-fPIC,即变成CFLAGS=-O3 -DUSE_MMAP -fPIC
安裝 freetype
代码:
tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure -prefix=/usr/local/freetype
make
make install
安裝 libpng
#不要用-prefix指定安装目录会影响GD
代码:
tar zxvf libpng-1.2.8-config.tar.gz
cd libpng-1.2.8-config
./configure
make
make install
=====有些用法=====
cp scripts/makefile.linux makefile
make
make install
===============
安裝 jpeg-7
代码:
tar zxvf jpegsrc.7.tar.gz
cd jpeg-7
./configure -prefix=/usr/local/jpeg --enable-shared --enable-static
make
make install
=====有些用法=====
CFLAGS="-O3 -fPIC" ./configure   #如果64位处理器需要 CFLAGS="-O3 -fPIC"
make
make install-lib
===============
這步有可能出錯,主要原因是不能自動建文件夾,到時出了問題,少那個文件夾,就自己用madir命令建那個文件夾就能解決
安裝 GD
代码:
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure -prefix=/usr/local/gd -with-jpeg=/usr/local/jpeg -with-png -with-zlib -with-freetype=/usr/local/freetype
make
make install
下一步需要配置 PHP 。
注:安裝imap的方法先下載imap2006e.tar.gz.Z
在php編譯時加上-with-imap=下載後解開的文件夾
這個也有點小問題,在maik時會出utf8_mime2text的錯,解決方法是先用find 查一下php源文件下的ext/php_imap.c 這個文件,然後用vi編緝他,查找utf8_mime2text,然後刪除那二行.
然後在重新編譯php就可以解決
PHP 配置
現在需要重新編譯 PHP,並選擇支援 GD,如果系統內已刪除了 PHP 的原始碼,可以到 php.net 下載,然後輸入以下指令:
請在configure 後加上如下
-with-gd=/usr/local/gd
-with-jpeg-dir=/usr/local/jpeg6 -with-zlib -with-png
-with-freetype-dir=/usr/local/freetype
代码:
--prefix=/usr/local/php --enable-sockets --enable-xsl --enable-xml --with-apxs2=/usr/local/apache/bin/apxs --witlih-mysql=/usr/local/mysql --enable-json --enable-mbstring --enable-pdo --enable-libxml --enable-simplexml --enable-xmlreader --enable-xmlwriter --with-zlib --with-pdo-mysql=/usr/local/mysql --with-curl=/usr/local/curl --with-jpeg-dir=/usr/local/jpeg -with-png  --with-gd=/usr/local/gd --with-freetype-dir=/usr/local/freetype



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/95470/showart_2023336.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP