centos 7 下用 phpize安装GD扩展库

 

yum 安装php

 

 

开启GD库须要的模块html

 freetype ,jpegsrc,libpnggit

 

用phpize安装web

 

查询php 开启模块curl

查询url

 

phpize扩展安装.net

 

 下载目录:/usr/src/freetype-1.3.1code

安装freetypehtm

[root@izm5e16gjdevwdl8q7q3qoz src]# wget https://jaist.dl.sourceforge.net/project/freetype/freetype/1.3.1/freetype-1.3.1.tar.gz

 

  

解压blog

[root@izm5e16gjdevwdl8q7q3qoz src]# tar zxvf freetype-1.3.1.tar.gz

[root@izm5e16gjdevwdl8q7q3qoz src]# cd freetype-1.3.1

 [root@izm5e16gjdevwdl8q7q3qoz freetype-1.3.1]# ./configure --prefix=/usr/local/freetype 

 

 

这里有个报错

解决办法

[root@izm5e16gjdevwdl8q7q3qoz freetype-1.3.1]# curl 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;

  

 

缺乏文件或者目录

 

yum install libX11-devel

 

 

yum install libpng libpng-devel libjpeg-turbo libjpeg-turbo-devel freetype freetype-devel gd

 

php源码下载

 

[root@izm5e16gjdevwdl8q7q3qoz src]# wget http://ftp.ntu.edu.tw/php/distributions/php-5.6.34.tar.gz

[root@izm5e16gjdevwdl8q7q3qoz src]#  tar zxvf php-5.6.34.tar.gz

[root@izm5e16gjdevwdl8q7q3qoz src]# cd php-5.6.34

 

 

 

 

 

[root@izm5e16gjdevwdl8q7q3qoz gd]# ./configure --with-jpeg-dir --with-png-dir --with-freetype-dir

make && make install

编译生成后的gd.so

/usr/src/php-5.6.34/ext/gd/modules/gd.so

动态加载目录

/usr/lib64/php/modules

 

[root@izm5e16gjdevwdl8q7q3qoz gd]# ./configure --with-php-config=/usr/bin/php-config --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --with-gd

 

 

编译路径

/usr/bin/phpize 

php源码目录

/usr/src/php-5.6.34

 

 

 

 

这里报错解决办法

1.

/usr/src/php-5.6.34/ext/gd/gd.c:57:22: fatal error: X11/xpm.h: No such file or directory

安装libXpm

[root@izm5e16gjdevwdl8q7q3qoz gd]# yum install libXpm-devel.x86_64

 

2.

/usr/src/php-5.6.34/ext/gd/gd.c:65:19: fatal error: t1lib.h: No such file or directory

 

yum install -y t1lib  t1lib-devel

相关文章
相关标签/搜索