测试代码出现报错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. <YaRN><Official doc><RM REST API's>

    Overview ... YARN Architecture The fundamental idea of YARN is to split up the functionalities of re ...

  2. Delphi直接实现分享图片功能

    procedure TCustomCameraViewDoc.ShareTextClick(Sender: TObject); var FSharingService: IFMXShareSheetA ...

  3. 4--Selenium环境准备---chromedriver.exe 与chrome版本匹配

    0.jdk8 和eclipse 4.6 https://www.eclipse.org/downloads/packages/release/neon/3 1.selenium-server-stan ...

  4. 初识爬虫见到的两个类 BufferedWriter和 BufferedReader

    BufferedWriter 和 BufferedReader 为带有默认缓冲的字符输出输入流,因为有缓冲区所以很效率比没有缓冲区的高. 使用BufferedWriter和BufferedReader ...

  5. [LeetCode&Python] Problem 696. Count Binary Substrings

    Give a string s, count the number of non-empty (contiguous) substrings that have the same number of ...

  6. Notepad2、Sublime_text带图标的右键快捷打开方式

    实现的效果:选中文本文件右键鼠标之后,按x键即可用notepad2快速打开文件,按3则可以用Sublime_text打开文件. 具体过程:根据各自需求,将下面的注册表信息,保存到本地新建的文本文件中, ...

  7. Gym101002 2016NAIPC(队内第7次训练)

    (由于先看的最后一题,然后又一直WA,导致这场有点爆炸,我背锅. A .Fancy Antiques 题意: 选择最多k个商店,买n个物品,每个物品分别对应两个店售卖,求最小花费是多少.n<10 ...

  8. 20155208徐子涵 2016-2017-2 《Java程序设计》第4周学习总结

    20155208徐子涵 2016-2017-2 <Java程序设计>第4周学习总结 教材学习内容总结 第六章 继承与多态 继承 继承作为面向对象的第二大特征,基本上就是避免多个类间重复定义 ...

  9. java中类加载时机

    java虚拟机规范虽然没有强制性约束在什么时候开始类加载过程,但是对于类的初始化,虚拟机规范则严格规定了有且只有四种情况必须立即对类进行初始化,遇到new.getStatic.putStatic或in ...

  10. ThinkPHP验证码类的使用

    1.创建一个方法并引入验证码类class ShowAction extends Action{//用户评论验证码public function verify(){import('ORG.Util.Im ...