测试代码出现报错Call to undefined function imagettftext(),发现是gd库出现了问题

通过phpInfo()查看 gd库已经开启,但是里边没有freeType 和jpeg的支持 但有png的支持
估计是 freetype 跟 jpeg没有安装

于是安装这两软件

yum install freetype*
yum install libjpeg*

装完后 找一下库装到哪里去了

find / -name freetype

结果在 /usr/include/freetype2/ 文件夹中

同理 libjpeg 在 /usr/include 中

然后进入php源代码的 php源代码(下载的代码)/ext/gd文件夹中 利用phpize进行拓展安装

(我的php安装在/usr/local/php中)
/usr/local/php/bin/phpize

./configure --with-freetype-dir=/usr/include/freetype2 --with-jpeg-dir=/usr/include --with-php-config=/usr/local/php/bin/php-config

然后

make
make install

到此 完成了php中GD库到重新编译,重启后问题圆满解决

Ps:
执行phpize的时候出现报错提示

Cannot find config.m4. Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module

解决方法:
进入php源码包目录:cd /usr/local/php-5.6.25/ext/openssl
执行命令: cp ./config0.m4 ./config.m4 即可

php Call to undefined function imagettftext()问题解决的更多相关文章

  1. Mac下Call to undefined function imagettftext() 解决方案

    文章转载至Mac下Call to undefined function imagettftext()终极解决方案 安装了一套onethink程序准备调试,结果在登录页面发现验证码无法显示,单独访问验证 ...

  2. Fatal error: Call to undefined function imagettftext()解决办法

    Fatal error: Call to undefined function imagettftext()解决办法   我的问题是php编译安装时指定了gd的目录,其实不用指定.就可以了 博客分类: ...

  3. Call to undefined function imagettftext()解决方法

    由 老高 发表于 2014-10-03  在 代码人生 分类 老高在一个新环境中装DEDECMS的时候发现后台验证码无法显示.直接搜索一下这个错误,有人说session错误,有的说权限错误等等,这不胡 ...

  4. 在已经编译安装好php7场景下,install gd库 with free-type (解决Call to undefined function imagettftext())

    在已经编译安装好php7场景下,install gd库 with free-type (解决Call to undefined function   imagettftext()) install g ...

  5. Mac php使用gd库出错 Call to undefined function imagettftext()

    第一次在Mac下使用ThinkPHP,用到验证码功能时报如题的错误: Call to undefined function Think\imagettftext() 然后检查自己的GD库,发现安装上了 ...

  6. linux又一次编译安装gd,添加freetype支持,解决验证码不显示问题,Fatal error: Call to undefined function imagettftext()

    问题: Fatal error: Call to undefined function Think\imagettftext() in /var/www/webreg/ThinkPHP/Library ...

  7. fatal error: call to undefined function imagettftext

    参照:http://stackoverflow.com/questions/7290958/php-fatal-error-call-to-undefined-function-imagettftex ...

  8. 关于 CI框架访问数据库类提示Call to undefined function mysqli_init() 问题解决

    我上次实践发现,安装在Win10 WampServer3.0.4集成环境,不仅打不开phpmyadmin会报错就算了,而且报错后又没提示那么解决,同时你打开php扩展配置发现,WampServer系统 ...

  9. php提示Fatal error: Call to undefined function imagecreate()

    在php中imagecreate函数是一个图形处理函数,主要用于新建一个基于调色板的图像了,然后在这个基础上我们可以创建一些图形数字字符之类的,但这个函数需要GD库支持,如果没有开启GD库使用时会 / ...

随机推荐

  1. EffecJava Method

    坚持使用Overrider注解,可以预防我们并没有重载的情况出现. 除非使用者绝对安全,不然使用保护性拷贝,可以使程序安全. public class Period {//没有拷贝安全 private ...

  2. C# struct and enum

    struct Person { public int age; public string name; public string fname; public string class; } enum ...

  3. UIIimageView读取图片的两种方式及动画的执行

    /**count:图片数量 name:图片名称*/ - (void)runAnimationWithCount:(int)count name:(NSString *)name { if(self.t ...

  4. 爬虫系列2:scrapy项目入门案例分析

    本文从一个基础案例入手,较为详细的分析了scrapy项目的建设过程(在官方文档的基础上做了调整).主要内容如下: 0.准备工作 1.scrapy项目结构 2.编写spider 3.编写item.py ...

  5. angular 学习日志

    1.创建项目 npm install -g @angular/cli ng new my-app cd my-app ng serve --open // 或者 npm start 2.生成新模块 n ...

  6. Eclipse远程调试Tomcat

    1.Linux服务器中在Tomcat的catalina.sh文件添加如下内容: CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,ad ...

  7. Kesci: Keras 实现 LSTM——时间序列预测

    博主之前参与的一个科研项目是用 LSTM 结合 Attention 机制依据作物生长期内气象环境因素预测作物产量.本篇博客将介绍如何用 keras 深度学习的框架搭建 LSTM 模型对时间序列做预测. ...

  8. Python学习笔记第二十一周

    目录: 1.URL 2.Models - 操作 3.Templates - html模板的使用 - 自定义函数 4.cookie和session 5.分页(自定义分页) 6.Form验证 内容: 1. ...

  9. e与复利

    e≍2.718 计算一个复利例子,设本金p,年利率为r,每月计算一次利息,月利息为r/12,则一年的本息一共: p(1+r/12)12=pq 当计算复利的时间间隔越来越小,根据上面极限公式,本金所乘的 ...

  10. Linux audit安全审计工具

    /********************************************************************** * Linux audit安全审计工具 * 说明: * ...