php5安裝GD庫
1.下載libpng庫,至少需要支持一種文件類型,如果需要其他的類型則另外下載
http://nchc.dl.sourceforge.net/project/libpng/00-libpng-stable/1.2.40/libpng-1.2.40.tar.gz
解壓縮后,進(jìn)入文件夾
cd libpng-1.2.40
mv scripts/makefile.linux ./Makefile #這里一定要使用script下的Makefile ,不要通過./configure
生成
make
make install
2.下載freetype庫,很多GD函數(shù)都需要這個(gè)庫的支持
http://ftp.twaren.net/Unix/NonGNU/freetype/freetype-2.3.5.tar.gz
解壓后
cd freetype-2.3.5
./configure --prefix=/usr/local/freetype #這里指定freetype的安裝目錄,以便php編譯時(shí)用到
make
make install
4.下載GD庫
從http://www.libgd.org上選擇合適的版本下載
解壓后進(jìn)入目錄
./configure --prefix=/usr/local/gd2 --with-png --with-freetype #這里不需要制定freetype目錄,
但是需要制定gd庫的安裝路徑
make
make install
5.編譯php
進(jìn)入php源碼目錄
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --without-sqlite --
without-pdo-sqlite --with-gd=/usr/local/gd2 --with-freetype-dir=/usr/local/freetype/
make
make install
重啟apache即可
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答??! 點(diǎn)擊進(jìn)入論壇