免费注册 查看新帖 |

Chinaunix

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

linux下php的GD安裝 [复制链接]

论坛徽章:
1
辰龙
日期:2014-05-15 19:37:15
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-02-07 22:09 |只看该作者 |倒序浏览

                                               


       
                       
                               
本文就是介紹在 Linux 下安裝 GD,並配置 PHP 支援 GD
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
建立安裝套件目錄
mkdir /usr/local/modules
下載完成後鍵入以下指令進行安裝。
安裝 zlib
#不要用–prefix指訂安裝目錄會影響GD
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make
make install
安裝 freetype
tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure –prefix=/usr/local/modules/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
安裝 jpeg-6b
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure –prefix=/usr/local/modules/jpeg6 –enable-shared –enable-static
make
make install
這步有可能出錯,主要原因是不能自動建文件夾,到時出了問題,少那個文件夾,就自己用madir命令建那個文件夾就能解決
安裝 GD
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure –prefix=/usr/local/modules/gd
–with-jpeg=/usr/local/modules/jpeg6 –with-png –with-zlib
–with-freetype=/usr/local/modules/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/modules/gd
–with-jpeg-dir=/usr/local/modules/jpeg6 –with-zlib –with-png
–with-freetype-dir=/usr/local/modules/freetype
其餘請自行加入
tar zxvf php-4.4.1.tar.gz
cd php-4.4.1
./configure 如上指令
make
make install
以上在 ./configure 裡的選項只可以參考,在編譯時必須根據自己的環境配置而修改,而 –with-gd 及 –with-zlib-dir=/usr/local 就是設定成支援 GD。
注:我个人的php的编译的设置.
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local --with-iconv --with-mbstring --enable-mbstring --enable-track-vars --enable-force-cgi-redirect --enable-ftp -with-gd=/usr/local/modules/gd/ -with-jpeg-dir=/usr/local/modules/jpeg6/ -with-zlib -with-png -with-freetype-dir=/usr/local/modules/freetype/ -with-iconv -with-imap=/usr/src/imap-2006e --with-imap-ssl --enable-versioning
               
               
               
               
               
               
               
               
               

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

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP