php 编译 freetype,php添加FreeType 库支持

刚编译了一个lamp,上线后发现验证码无法显示, 和网站沟通后,说是p_w_picpathttftext()。

函数同时需要 GD 库和 FreeType 库。 通过产查看phpinfo();后发现没有freetype的支持,

下面是添加freetype支持的方法

cd /usr/src/php.5.4.4

cat config.nice -->这个是你上次成功编译的参数

我的系统是centos6.2 X86_64的 freetype的位置在 /usr/include/freetype2/freetype/

不知道的同学, 可以通过find / -name freetype* 进行查找,

之后在编译配置的参数上添加上 --with-freetype-dir=/usr/include/freetype2/freetype/ 就ok了

另外贴一下我的配置参数

./configure

--prefix=/usr/local/php

--enable-mbstring

--with-apxs2=/usr/local/apache/bin/apxs

--with-mysql=/usr/local/mysql

--with-config-file-path=/usr/local/php

--enable-session

--with-bz2

--with-gd

--enable-sockets

--with-freetype-dir=/usr/include/freetype2/freetype/

刚编译了一个lamp,上线后发现验证码无法显示, 和网站沟通后,说是p_w_picpathttftext()。 函数同时需要 GD 库和 FreeType 库。 通过产查看phpinfo();后发现没有freetype的支持, 下面是添加freetype支持的方法 cd /usr/src/php.5.4.4 cat config.nice -->这个是你上次成功编译的参数 我的系统是centos6.2 X86_64的 freetype的位置在 /usr/include/freetype2/freetype/ 不知道的同学, 可以通过find / -name freetype* 进行查找, 之后在编译配置的参数上添加上 --with-freetype-dir=/usr/include/freetype2/freetype/ 就ok了 另外贴一下我的配置参数 ./configure --prefix=/usr/local/php --enable-mbstring --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php --enable-session --with-bz2 --with-gd --enable-sockets --with-freetype-dir=/usr/include/freetype2/freetype/
经验分享 程序员 微信小程序 职场和发展