Call to undefined function imagettftext()解决方法
老高在一个新环境中装DEDECMS的时候发现后台验证码无法显示。直接搜索一下这个错误,有人说session错误,有的说权限错误等等,这不胡扯么!只能看源代码了,定位到文件/include/vdimgck.php
。出错的函数是imagettftext()
,由于织梦使用了@
将错误隐去,导致这次莫名的错误。将@
去掉,错误立马出现:
Fatal error: Call to undefined function imagettftext()
现在我们就明确了,出现错误的原因是PHP编译时没有加上FreeType。
解决办法:
首先编译安装FreeType,以2.4.0为例:
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.bz2
tar -jxf freetype-2.4.0.tar.bz2
cd reetype-2.4.0
# 安装到/usr/local/freetype
./configure --prefix=/usr/local/freetype
make && make install
下面我们重新编译PHP,加上参数--with-freetype-dir=/usr/local/freetype
./configure \
... \
... \
--with-freetype-dir=/usr/local/freetype
编译完成重启php
kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`
再GD库中找到FreeType Support
说明安装成功!
需要注意的是,如果服务器freetype的版本是1.*,那么你可能需要改变编译参数为--with-ttf[=DIR]
,以下转自ChinaUnix论坛:
字库 配置开关
FreeType 1.x 要激活 FreeType 1.x 的支持,加上 --with-ttf[=DIR]。
FreeType 2 要激活 FreeType 2 的支持,加上 --with-freetype-dir=DIR。
T1lib 要激活 T1lib(Type 1 字体),加上 --with-t1lib[=DIR]。
本地 TrueType 字符串函数 要激活本地 TrueType 字符串函数的支持,加上 --enable-gd-native-ttf。
参考:
Call to undefined function imagettftext()解决方法的更多相关文章
- Fatal error: Call to undefined function imagettftext()解决办法
Fatal error: Call to undefined function imagettftext()解决办法 我的问题是php编译安装时指定了gd的目录,其实不用指定.就可以了 博客分类: ...
- Call to undefined function curl_init()解决方法
今天在使用php中的 curl 扩展时 在开启
- undefined function mysql_connect()解决方法
在配置apache+php+mysql后,打开一个php网页文件正常,但是php网页中连接数据库时,出现以下提示: Fatal error: Call to undefined function my ...
- php运行出现Call to undefined function curl_init()解决方法
php运行出现Call to undefined function curl_init() 64位win7/8 下PHP不支持CURL 除了将PHP.ini中的;extension=php_curl. ...
- 在已经编译安装好php7场景下,install gd库 with free-type (解决Call to undefined function imagettftext())
在已经编译安装好php7场景下,install gd库 with free-type (解决Call to undefined function imagettftext()) install g ...
- php Call to undefined function imagettftext()问题解决
测试代码出现报错Call to undefined function imagettftext(),发现是gd库出现了问题 通过phpInfo()查看 gd库已经开启,但是里边没有freeType 和 ...
- [转载][jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
参考 [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 ---------------------------------------- ...
- Mac下Call to undefined function imagettftext() 解决方案
文章转载至Mac下Call to undefined function imagettftext()终极解决方案 安装了一套onethink程序准备调试,结果在登录页面发现验证码无法显示,单独访问验证 ...
- [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法
原文:[jQuery1.9]Cannot read property 'msie' of undefined错误的解决方法 $.browser在jQuery1.9里被删除了,所以项目的js代码里用到$ ...
随机推荐
- HDU5742:It's All In The Mind(模拟+贪心 )
题意: 给出n和m,表示n个数,之后会给出m个下标xi和值yi,a[xi]=yi,n个数是不下降的,且总和>0,要使得(x1+x2)/∑(xi)最大. 分析: 尽可能使得前两个数最大,其他数尽可 ...
- cocos2d-x 3.0 创建工程的模板
将下面的代码拷贝到文本文件中,重命名文件为 cocos3.0创建工程.bat @echo off echo -------------------------create project with p ...
- crontab 获取本机ip
写了个shell获取ip的函数,如下 function GetLocalIP() { ifconfig | grep 'inet '| grep -v '127.0.0.1' | cut -d: -f ...
- 问题-XE8报Object factory for class{xx-xx-xx-xx-xx} is missing. To register it, you can drop component[TFDGUIxWaitCursor] into your project.
问题现象:XE8开发数据访问程序时放入了FDPhysMSSQLDriverLink1.FDConnection1.FDConnection1.FDQuery1.DBGrid1,设计期没法,运行期报&q ...
- java volatile进阶(一)
本篇文章继续学习volatile.上篇文章简单的介绍了volatile和synchonized,这篇文章讲一下什么时候可以用volatile. 先看一段代码. package com.chzhao.v ...
- nyoj 120 校园网络(求添加多少条边使整个图强连通)
校园网络 时间限制:3000 ms | 内存限制:65535 KB 难度:5 描述 南阳理工学院共有M个系,分别编号1~M,其中各个系之间达成有一定的协议,如果某系有新软件可用时,该系将允许一 ...
- AutoCAD.NET二次开发:扩展数据之XData
结果缓存——ResultBuffer 结果缓存即 Autodesk.AutoCAD.DatabaseServices.ResultBuffer 类型,使用 ResultBuffer 对象时需要提供一个 ...
- ServletContext2
------------ContextServlet.java--------------节选-- protected void doGet(HttpServletRequest request, H ...
- C#客户端链接网页需要用到的WebClient
WebClient 类提供向 URI 标识的任何本地.Intranet 或 Internet 资源发送数据以及从这些资源接收数据的公共方法. WebClient 类使用 WebRequest 类提供对 ...
- appcompat_v7/res/values-v21/themes_base.xml No resource found that matches the given name
今天晕死了 将工作区里的appcompat_v7删除掉了, 然后随意新建了一个工程,因为已经升级到5.0了,appcompat_v7内容有所改变, 以前的工程引用旧的appcompat_v7的某些属性 ...