為PHP配置GD庫
安裝zlib
root@localhost:~# tar zxvf zlib-1.2.3.tar.gz
root@localhost:~# cd zlib-1.2.3/
root@localhost:~/zlib-1.2.3#
root@localhost:~/zlib-1.2.3# ./configure --prefix=/usr/local/zlib
Checking for gcc...
Building static library libz.a version 1.2.3 with gcc.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for errno.h... Yes.
Checking for mmap support... Yes.
root@localhost:~/zlib-1.2.3# make
root@localhost:~/zlib-1.2.3# make install
安裝libpng
root@localhost:~# tar jxvf libpng-1.2.8.tar.bz2
root@localhost:~/libpng-1.2.8# mv ./scripts/makefile.linux ./makefile
root@localhost:~/libpng-1.2.8# make
root@localhost:~/libpng-1.2.8# make install
安裝freetype
root@localhost:~# tar zxvf freetype-2.1.10.tar.gz
root@localhost:~# cd freetype-2.1.10/
root@localhost:~/freetype-2.1.10# ./configure --prefix=/usr/local/freetype
root@localhost:~/freetype-2.1.10# make
root@localhost:~/freetype-2.1.10# make install
安裝Jpeg
root@localhost:~# tar zxvf jpegsrc.v6b.tar.gz
root@localhost:~# cd jpeg-6b/
root@localhost:~/jpeg-6b# ./configure --prefix=/usr/local/jpeg6 --enable-shared --enable-static
--enable-shared引數用來設定生成共享庫
root@localhost:~/jpeg-6b# make
./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c
make: ./libtool: Command not found
make: *** [jcapimin.lo] Error 127
root@localhost:/etc/apt# ls
apt.conf.d sources.list~ sources.list.d trusted.gpg~
preferences.d sources.listbak trustdb.gpg trusted.gpg.d
sources.list sources.list_bak2 trusted.gpg
root@localhost:/etc/apt# cp sources.list_bak2 sources.list
sources.list_bak2為我自己建立的本地源列表
root@localhost:/etc/apt# cat sources.list_bak2
deb file:///media/cdrom precise main
root@localhost:/etc/apt# apt-get update
root@localhost:/etc/apt# apt-get install libtool
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
autotools-dev libltdl-dev
Suggested packages:
libtool-doc autoconf automaken gfortran fortran95-compiler gcj
The following NEW packages will be installed:
autotools-dev libltdl-dev libtool
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/547 kB of archives.
After this operation, 2,561 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
root@localhost:~# cd jpeg-6b/
root@localhost:~/jpeg-6b# make clean
rm -f *.o *.lo libjpeg.a libjpeg.la
rm -f cjpeg djpeg jpegtran rdjpgcom wrjpgcom
rm -f ansi2knr core testout* config.log config.status
rm -f -r knr .libs _libs
root@localhost:~/jpeg-6b# cp /usr/share/libtool/config/config.sub .
root@localhost:~/jpeg-6b# cp /usr/share/libtool/config/config.guess .
root@localhost:~/jpeg-6b# ./configure --prefix=/usr/local/jpeg6 --enable-shared --enable-static
該版本有待更正 無法自動建立安裝目錄,自己建立一下:
mkdir -p /usr/local/jpeg/include
mkdir -p /usr/local/jpeg/lib
mkdir -p /usr/local/jpeg/bin
mkdir -p /usr/local/jpeg/man/man1
編譯安裝
root@localhost:~/jpeg-6b# make
root@localhost:~/jpeg-6b# make install
安裝GD
root@localhost:~# tar zxvf gd-2.0.33.tar.gz
root@localhost:~# cd gd-2.0.33/
root@localhost:~/gd-2.0.33# ./configure --with-png --with-jpeg --with-freetype=/usr/local/freetype
root@localhost:~/gd-2.0.33# make
root@localhost:~/gd-2.0.33# make install
安裝php
注:如若已經安裝過php 刪除安裝目錄即可:
root@localhost:~# rm -rf /usr/local/php5
root@localhost:~# tar zxvf php-5.4.4.tar.gz
root@localhost:~# cd php-5.4.4/
root@localhost:~/php-5.4.4# ./configure --prefix=/usr/local/php5/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql5/ --enable-mbstring --with-gd --enable-gd-native-ttf --with-zlib-dir=/usr/local/zlib --with-freetype-dir=/usr/local/freetype
root@localhost:~/php-5.4.4# make
root@localhost:~/php-5.4.4# make install
root@localhost:~# /usr/local/apache2/bin/apachectl stop
root@localhost:~# /usr/local/apache2/bin/apachectl start
測試
[root@orcl10g ~]# cd /usr/local/apache2/htdocs/
輸入指標函式顯示php資訊
[root@orcl10g htdocs]# vi index.php
寫入內容如下:
phpinfo();
?>
瀏覽器檢視有無gd引數
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29320885/viewspace-1189569/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- PHP系列(十)GD庫PHP
- PHP中GD庫的使用PHP
- IIS+PHP+MySQL+ZendOptimizer+GD庫+phpMyAdmin安裝配置PHPMySql
- PHP的GD庫函式大全PHP函式
- Linux配置APACHE2.0.55 +PHP5.1.1+MYSQL5.0.16+GD庫(轉)LinuxApachePHPMySql
- linux下配置APACHE2.0.50+PHP5.0.3+MYSQL4.0.20+GD庫(轉)LinuxApachePHPMySql
- centos下為php新增gd擴充套件CentOSPHP套件
- PHP 安裝 GD 圖形擴充套件庫(報錯:GD Library ... this PHP installation.)PHP套件
- PHP GD庫解析一張簡單圖片並輸出PHP
- PHP GD庫與Imagick庫簡單使用及區別(切換到Imagick)PHP
- 5.3.php5-gd-GDmoduleforphp5PHP
- linux_php_jpeg6,png,gdLinuxPHP
- GD庫的安裝(轉)
- php gd庫擴充套件生成帶中文字型的png圖片PHP套件
- Docker 安裝 PHP7.4 GD擴充套件DockerPHP套件
- apache2.2+PHP5.2.3+mysql5.0+gd+zend+phpmyadminApachePHPMySql
- Linux下PHP的GD2安裝方法LinuxPHP
- 基於 GD 庫生成圓形頭像
- Linux 增加PHP擴充套件gd庫套件
- CalltoundefinedfunctionImageCreate()錯誤解決擴充套件gd庫UndefinedFunction套件
- dedecms資料庫配置檔案所在路徑為:/data/common.inc.php資料庫PHP
- 【例項】使用GD庫生成圖片驗證碼
- 織夢php資料庫配置檔案PHP資料庫
- 4 為效能配置資料庫資料庫
- 為RMAN操作配置資料庫資料庫
- Apache+SSL+PHP+JSP+MySQL+IMAP+GD安裝全攻略(轉)ApachePHPJSMySql
- GD 庫 PNG 透明底圖片新增文字及圖片水印
- Web前端技巧分享:教你用GD庫生成驗證碼Web前端
- 基於gd庫和phpqrcode的海報生成外掛PHP
- 安裝GD庫解決ThinkPHP驗證碼CalltoundefinedfunctionThinkimagecreate()出錯PHPUndefinedFunction
- RedhatAS4.0上安裝Apache2+PHP5+MySQL+Resin+SSL+GD+webalizerRedhatApachePHPMySqlWeb
- 在Linux上為PHP配置OCI8連線LinuxPHP
- 史上最簡單的讓PHP支援GD的方法,對菜鳥尤其適合PHP
- Apache + PHP配置ApachePHP
- PHP常用配置PHP
- linux 下 gd 安裝Linux
- PbootCMS資料庫配置,修改為Mysql資料庫,配置Mysql出錯解決辦法boot資料庫MySql
- 網站資料庫配置檔案config.php網站資料庫PHP