Centos安裝GD庫

來源:互聯網
上載者:User

標籤:http   os   ar   使用   for   檔案   on   ad   bs   

tar zxvf ncurses-5.6.tar.gz 進入目錄 cd ncurses-5.6
產生 makefile檔案,
再進一步編譯
./configure --prefix=/usr --with-shared --without-debug 編譯,編譯時間稍微長些,稍等
make
編譯好最後就是安裝了
make install
==================================
下面才開始安裝 GD庫,安裝gd庫成功與否,與下面的安裝順序有一定的關係 我們就一步步來示範安裝, 下面所有用到的檔案,可以到 http://www.tabcn.cn/download/gd_all.7z下載 把全部的檔案 都放進 webserv 目錄下
1: 安裝zlib2 同樣, 在Linux下使用 wget 來下載檔案 tar zxvf zlib-1.2.3.tar.gz cd zlib-1.2.3 ./configure --prefix=/usr/local/zlib make make install
---------------------------------
2:安裝PNG
tar zxvf libpng-1.2.26.tar.gz cd libpng-1.2.26
cp scripts/makefile.linux ./makefile
./configure --prefix=/usr/local/libpng
make
make install
---------------------------------
3:安裝ttf ( ttf 是字型的支援 )
tar zxvf freetype-2.3.5.tar.gz cd freetype-2.3.5
./configure --prefix=/usr/local/freetype
make
make install
---------------------------------
4:安裝JPEG6
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
mkdir -pv /usr/local/libjpeg/{,bin,lib,include,man/man1,man1}
上面這個命令具體是實現這樣的:
mkdir: created directory `/usr/local/libjpeg‘
mkdir: created directory `/usr/local/libjpeg/bin‘
mkdir: created directory `/usr/local/libjpeg/lib‘
mkdir: created directory `/usr/local/libjpeg/include‘
mkdir: created directory `/usr/local/libjpeg/man‘
mkdir: created directory `/usr/local/libjpeg/man/man1‘
mkdir: created directory `/usr/local/libjpeg/man1‘
可以說是一個小小的bug吧,要我們手動建立這些目錄,否則configure時候會說找不到目錄。
./configure --prefix=/usr/local/libjpeg --enable-shared --enable-static
make
make install
---------------------------------
5:安裝 libxml2
tar zxvf libxml2-2.6.31.tar.gz
cd libxml2-2.6.31
./configure --prefix=/usr/local/libxml2
make
這一步make 操作 時間相對也會比較長,呵呵
make install
cp xml2-config /usr/bin
---------------------------------
6:安裝 libmcrypt-2.5.7.tar.gz
tar zxvf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make
make install
---------------------------------
7:安裝Fontconfig
tar -zxvf fontconfig-2.4.2.tar.gz
cd fontconfig-2.4.2
可以看到, 參數比較長, 我建議用記事本的朋友不要選擇 自動換行。
看我操作, 自動換行 複製過去執行有時會出錯。
去掉 自動換行
./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/freetype/bin/freetype-config
這裡顯示一個錯誤資訊:
checking for LIBXML2... configure: error: Package requirements (libxml-2.0 >= 2.6) were not met: No package ‘libxml-2.0‘ found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBXML2_CFLAGS and LIBXML2_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
但是我們在上面其實已經安裝上 libxml2 了的,這裡只是一個 環境變數沒有設定好而已。
解決辦法:
確定 /usr/local/libxml2/lib/pkgconfig 目錄下有 libxml-2.0.pc
export PKG_CONFIG_PATH=/usr/local/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH
再次產生 makefile , 這樣就成功了
./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/freetype/bin/freetype-config
好了吧,沒有出現那個錯誤了。
make
make install
---------------------------------
8:安裝GD庫,
我們把這一步放在最後面
tar zxvf gd-2.0.35.tar.gz cd gd-2.0.35 ./configure --prefix=/usr/local/libgd --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/libjpeg --with-fontconfig=/usr/local/fontconfig
看到下面的資訊, 呵呵 很多都顯示支援了 Support for PNG library: yes Support for JPEG library: yes Support for Freetype 2.x library: yes Support for Fontconfig library: yes Support for Xpm library: no Support for pthreads: yes make make install 好了, 到這裡為止 安裝GD庫全部過程示範完了。

Centos安裝GD庫

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.