今天在做图形验证码的时候,在windows运行好好的代码在CentOS下却无法运行了。报了如下警告

Warning: imagettfbbox(): Could not read font in /mnt/hgfs/web/test/clicaptcha.class.php on line 15

通过查看文章得知,需要使用的字体类型是TrueType fonts

原本默认的是使用的SourceHanSansCN-Normal.otf字体,如下图,通过file命令查看得知是属于OpenType类型,虽然在windows下是可以的,但是在CentOS下却出现了,兼容性问题,所以我有找了一个TrueType字体进行替换,替换后就好了

Warning: imagettfbbox(): Could not read font in XXX on line X的更多相关文章

  1. [可能没有默认的字体]Warning: imagettfbbox() [function.imagettfbbox]: Invalid font filename...

    Warning: imagettfbbox() [function.imagettfbbox]: Invalid font filename... [可能没有默认的字体] 例: //putenv('G ...

  2. Warning: Multiple build commands for output file /xxx

    xcode中 有时候会报一个警告: [WARN]Warning: Multiple build commands for output file /xxx 要解决这个问题很简单: 1.选择你的工程 2 ...

  3. Error running 'xxx': Command line is too long. Shorten command line for xxx

    跑单元测试时,报错如下: Error running 'xxx': Command line is too long. Shorten command line for xxx 解决方案: 在项目所在 ...

  4. Warning: Received `false` for a non-boolean attribute `xxx`.

    React对boolean类型的attribute的识别方式问题,可以采用以下方法解决: xxx={value ? 1 : 0} 改成数字的写法,不用布尔值. 具体可以参考:https://githu ...

  5. warning : json_decode(): option JSON_BIGINT_AS_STRING not implemented in xxx

    先来一段json_decode官方说明 mixed json_decode ( string $json [, bool $assoc = false [, int $depth = 512 [, i ...

  6. PHP “Warning: session_start()...”、"correct (..\..\php5\Temp) in Unknown on line 0" 的解决方法

    运行php的时候出现了一下警告: Warning: Unknown: open(D:/Program Files/php5/temp1\sess_l5b1a48m6kmb1g0t5cs33690v0, ...

  7. mysql 帮助手册 以及 warning: World-writable config file 以及 ERROR 1840 (HY000) at line 24:

    1. mysql --help 2.报错 报错Warning: World-writable config file http://www.jb51.net/article/99027.htm 最近在 ...

  8. BEAMER中 Package Listings Warning: Text dropped after begin of listing on input line xx

    Latex Beamer 模板 frame 中使用 listings package时总出现标题所示错误,无法前进.解决方法是在\begin{frame}后加上一个选项,即:\begin{frame} ...

  9. pyhon SyntaxError: Non-ASCII character '\xe8' in file xxx on line xx, but no encoding

    import math if __name__ == '__main__':    name1 = raw_input("请输入您的编号:")    print name1 完整的 ...

随机推荐

  1. CentOS7 下安装GUI图形界面GNOME

    在安装Gnome包之前,需要检查一下网络是否有网络(使用ping www.baidu.com) 一.先装X windows,-y表示参数同意所有软件安装操,当出现 Complete!说明这里安装成功了 ...

  2. FTP做作业用到的知识点:

    FTP做作业用到的知识点: 一: os.path 模块下常用的用法 os.path.abspath(file) #返回的是.py文件的绝对路径(完整路径) os.path.dirname(file) ...

  3. tomcat中如何禁止列目录下的文件

    tomcat中如何禁止列目录下的文件在{tomcat_home}/conf/web.xml中,把listings参数设置成false即可,如下: <servlet> <servlet ...

  4. spring boot 源码分析

    说明:spring boot版本 2.0.6.RELEASE 思绪 首先,大家认识spring boot是从@SpringBootApplication注解和org.springframework.b ...

  5. laravel-重定向携带自定义消息

    在控制器写: return redirect(route('member_create'))->with('success', '操作成功'); //指定到路由名member_create // ...

  6. centos/RHEL 7.6 使用yum安装php7.3(方便wordpress的php7.3需求,并解决了libphp7.so缺失问题)

    我最近想安装一个wordpress, 但是官网介绍需要php7.3以上版本,但是百度了一下,都是要编译安装. 为此,我想,centos..., php... 两大当红辣子鸡没有yum安装方式,简直不可 ...

  7. 【mysql】:mysql性能优化总结

    一.Mysql引擎概述 1.MyISAM存储引擎 MyISAM表是独立于操作系统的,这说明可以轻松地将其从Windows服务器移植到Linux服务器:每当我们建立一个MyISAM引擎的表时,就会在本地 ...

  8. 关于numpy中的函数return中加入字符串类型数据后,小数点精度变化

    weekdays.pyimport numpy as npfrom datetime import datetimedef datestr2num(s): return datetime.strpti ...

  9. 关于get和post请求的区别

    1.标准答案 GET在浏览器回退时是无害的,而POST会再次提交请求. GET产生的URL地址可以被Bookmark,而POST不可以. GET请求会被浏览器主动cache,而POST不会,除非手动设 ...

  10. 2019.03.29 bzoj5463: [APIO2018] 铁人两项(圆方树+树形dp)

    传送门 题意简述:给你一张无向图,问你满足存在从a−>b−>ca->b->ca−>b−>c且不经过重复节点的路径的有序点对(a,b,c)(a,b,c)(a,b,c) ...