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代码里用到$ ...
随机推荐
- gdb 技巧
现实数组: 比如说要显示a[10]中全部的内容用 p a显示的是地址,用p *a显示的是第一个元素显示全部或某一个:p (int [10])*a或者p *a@10 如果你使用 p *a@3 或 p * ...
- unsupported dynamic reloc R_ARM_REL32 AND hidden symbol '__dso_handle' is not defined
项目里编译codec src\makefiles\android\codec\Makefileline 25 原本用 4.6 不会报错-L/data/android/android-ndk/sourc ...
- 【现代程序设计】【期末作业】【homework-09】
作业要求说明: http://www.cnblogs.com/xinz/p/3441537.html 我在做一个什么样的应用: 展示如何逐步求解一个加权矩阵的 最大子矩阵 任意联通图形 下面是软件的截 ...
- [iOS微博项目 - 1.2] - 导航栏搜索框
A.导航栏搜索框 1.需求 在“发现”页面,在顶部导航栏NavigationBar上添加一个搜索框 左端带有“放大镜”图标 github: https://github.com/hellovoidwo ...
- Redis安装与调试
Redis安装与调试 Redis安装与调试linux版本:64位CentOS 6.5 Redis版本:2.8.17 (更新到2014年10月31日) Redis官网:http://redis.io/ ...
- js即时监听文本内容
<script type="text/javascript"> //其他浏览器 function OnInput (event) { alert ("文本内容 ...
- 使用 EPPlus,NPOI,操作EXCEL
NPOI, 读取xls文件(Excel2003及之前的版本) (NPOI.dll+Ionic.Zip.dll) http://npoi.codeplex.com/ EPPlus ...
- git使用具体介绍
1. Git概念 1.1. Git库中由三部分组成 Git 仓库就是那个.git 文件夹,当中存放的是我们所提交的文档索引内容,Git 可基于文档索引内容对其所管理的文档进行内容追踪 ...
- SAP BW标准模型简介(BW星形模型 BW Star Schema )
标准星型模型是 数据仓库中一种常用的组织信息和数据的多维数据模型.它由中心的一个事实表(Fact Table)和一些围绕它的维度表(Dimensional Table)组成. 事实(Fact)着眼于 ...
- TC srm 673 300 div1
TC srm.673 300 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 Description 给你n(n<=50)匹马和n个人,一匹马和一个人能 ...