linux php 安裝GD庫

來源:互聯網
上載者:User
linux下為php添加GD庫的步驟如下:


一、下載

gd-2.0.33.tar.gz http://www.boutell.com/gd/
jpegsrc.v6b.tar.gz http://www.ijg.org/
libpng-1.2.7.tar.tar http://sourceforge.net/projects/libpng/
zlib-1.2.2.tar.gz http://sourceforge.net/projects/zlib/
freetype-2.1.9.tar.gz http://sourceforge.net/projects/freetype/
php-4.3.9.tar.gz http://www.php.net


二、安裝

1.安裝zlib

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

2.安裝libpng

tar zxvf libpng-1.2.7.tar.tar
cd libpng-1.2.7
cd scripts/
mv makefile.linux ../makefile
cd ..
make
make install
注意,這裡的makefile不是用./configure產生,而是直接從scripts/裡拷一個

3.安裝freetype

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

4.安裝Jpeg

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

5.安裝GD

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

6.重新編譯PHP

tar zxvf php-4.3.9.tar.gz
cd php-4.3.9
./configure (以前的參數) --with-gd --enable-gd-native-ttf --with-zlib --with-png --with-jpeg --with-freetype --enable-sockets
make
make install

phpinfo();
?>

Ok.....
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.