亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

配置PHP對gd庫的支持

標簽:
PHP

搭建zabbix的时候遇到有对PHP的需求检测,发现没有对gd的支持,记录下。。。

GD库是php处理图形的扩展库,它提供了一系列用来处理图片的API,使用GD库可以处理图片,或者生成图片,也可以给图片加水印。

1、安装zlib,一般系统自带已经安装好,可以用以下命令去查看:
rpm -qa | grep zlib


2、安装libpng
cd /tmp
wget "https://jaist.dl.sourceforge.net/project/libpng/libpng16/1.6.32/libpng-1.6.32.tar.xz"
xz -d libpng-1.6.32.tar.xz
tar xf libpng-1.6.32.tar
cd libpng-1.6.32
./configure
make
make install
安装目录是:/usr/local/include

3、安装freetype
cd /tmp
wget "https://jaist.dl.sourceforge.net/project/freetype/freetype2/2.8.1/freetype-2.8.1.tar.bz2"
tar -jxvf freetype-2.8.1.tar.bz2
cd freetype-2.8.1
./configure
make
make install
安装目录是:/usr/local/include

4、安装jpeg
cd /tmp
wget "http://jpegclub.org/support/files/jpegsrc.v6b2.tar.gz"
tar zxf jpegsrc.v6b2.tar.gz
cd jpeg-6b2/
./configure --enable-shared
make
make test
make install
安装目录是:usr/local/include

5、安装GD
cd /tmp
https://bitbucket.org/libgd/gd-libgd/downloads/  (官网)
tar xf libgd-2.1.1.tar
cd libgd-2.1.1/
./configure --with-png --with-freetype --with-jpeg
make
make install

安装目录是:usr/local/include


6、安装PH
cd /tmp
wget http://cn2.php.net/distributions/php-5.6.0.tar.xz
xz -d php-5.6.0.tar.xz
tar xf php-5.6.0.tar
cd php-5.6.0/

./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd  --enable-sockets --enable-bcmath  --enable-mbstring --with-gd --with-zlib --with-png-dir=/usr/local/include/libpng16/  --with-jpeg-dir=/usr/local/include  --with-freetype-dir=/usr/local/include/freetype2/freetype

make
make install

cp /tmp/php-5.6.0/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm

cp /tmp/php-5.6.0/php.ini-development  /usr/local/webserver/php/etc/php.ini
cd /usr/local/webserver/php/etc && cp php-fpm.conf.default php-fpm.conf

vim /usr/local/webserver/php-5.6/etc/php.ini
     date.timezone = Asia/Shanghai

vim ~/.bash_profile
    PATH=$PATH:$HOME/bin:/usr/local/webserver/php-5.6/bin
source ~/.bash_profile

/etc/init.d/php-fpm start

點擊查看更多內容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優質文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學習,寫下你的評論
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優惠券免費領

立即參與 放棄機會
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

舉報

0/150
提交
取消