linux GD库安装
GD 安裝
第一部需要做的是先要安裝 GD 到系統(tǒng)內(nèi),而安裝 GD 前需要安裝 jpeg-6b, libpng, zlib, freetype。以下是下載網(wǎng)址:
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指定安裝目錄會(huì)影響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指定安裝目錄會(huì)影響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
===============
這步有可能出錯(cuò),主要原因是不能自動(dòng)建文件夾,到時(shí)出了問(wèn)題,少那個(gè)文件夾,就自己用madir命令建那個(gè)文件夾就能解決
安裝 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編譯時(shí)加上-with-imap=下載後解開(kāi)的文件夾
這個(gè)也有點(diǎn)小問(wèn)題,在maik時(shí)會(huì)出utf8_mime2text的錯(cuò),解決方法是先用find 查一下php源文件下的ext/php_imap.c 這個(gè)文件,然後用vi編緝他,查找utf8_mime2text,然後刪除那二行.
然後在重新編譯php就可以解決
PHP 配置
現(xiàn)在需要重新編譯 PHP,並選擇支援 GD,如果系統(tǒng)內(nèi)已刪除了 PHP 的原始碼,可以到 php.net 下載,然後輸入以下指令:
請(qǐng)?jiān)赾onfigure 後加上如下
-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
轉(zhuǎn)載于:https://www.cnblogs.com/shanglinxuan/p/5119693.html
總結(jié)
以上是生活随笔為你收集整理的linux GD库安装的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Android View 事件分发机制详
- 下一篇: 腾讯下一个重点:硬件;硬件自身的未来也正