mark一個php裝配gd拓展的文章

來源:互聯網
上載者:User
mark一個php安裝gd拓展的文章
mark一個php安裝gd拓展的文章
源地址:http://www.heiok.com/?p=517
由於PHP是源碼編譯安裝的,所以以上兩個擴充都沒安裝,下面是為PHP添加這兩個擴充的過程:


一、安裝GD擴充

1.下載安裝GD庫擴充所需源碼包(可點擊源碼包直接下載)

gd-2.0.35.tar.gz http://www.libgd.org/releases/

jpegsrc.v8b.tar.gz http://www.ijg.org/

libpng-1.5.0.tar.gz http://sourceforge.net/projects/libpng/

freetype-2.4.4.tar.gz http://sourceforge.net/projects/freetype/

zlib-1.2.3.tar.gz

2.分別編譯安裝各個源碼包

安裝zlib

tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make
make install

安裝libpng

tar zxvf libpng-1.5.0.tar.tar
cd libpng-1.5.0
cd scripts
mv makefile.linux ../makefile
cd ..
make
make install

安裝freetype

tar zxvf freetype-2.4.4.tar.gz
cd freetype-2.4.4
./configure
make
make install

安裝Jpeg

tar zxvf jpegsrc.v8b.tar.gz
cd jpeg-8b
./configure -enable-shared
make
make test
make install
注意,這裡configure一定要帶-enable-shared參數,不然,不會產生共用庫

安裝GD庫
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure -with-png -with-freetype -with-jpeg
make install

3.重新編譯安裝PHP(即是在以前編譯PHP的參數後面再加上以上安裝的相關參數)

cd php-5.3.4 (進入以前的PHP源碼目錄)

./configure –prefix=/opt/php –with-mysql=/opt/mysql –with-apxs2=/opt/apache/bin/apxs –enable-track-vars –enable-force-cgi-redirect –with-config-file-path=/opt/php/etc –with-gd –enable-gd-native-ttf –with-zlib –with-png –with-jpeg –with-freetype –enable-sockets

綠色字型部份是以前安裝PHP時所加的參數

make

make install

這樣GD庫擴充便安裝完畢,重啟Apache,查看PHP資訊測試頁便可看到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.