今天在做图形验证码的时候,在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. 【aardio】是否取消三个按键的对话框

    import win; var id = win.msgbox("三个按钮","标题",0x3/*_MB_YESNOCANCEL*/) 参考标准库函数: nam ...

  2. js 中 (function($){...})(jQuery) 含义

    js中定义函数常用写法是 function name(arg){ //arg则是匿名函数的参数. //... } 调用函数时的写法是: name(arg); ===================== ...

  3. Sql Server免域,异地备份

    --先决条件 开启xp_cmdshellEXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_c ...

  4. AtCoder Regular Contest 090

    C - Candies 链接:https://arc090.contest.atcoder.jp/tasks/arc090_a 题意:从左上角走到右下角,只能向右和向下走,问能最多能拿多少糖果. 思路 ...

  5. MySQL中的latch(闩锁)详解——易产生的问题以及原因分析

    Latch 什么是latch: 锁是数据库系统区别与文件系统的一个关键特性.锁机制用于管理对共享资源的并发访问.Innodb存储引擎在行级别上对表数据上锁,这固然不错.但是Innodb也会在多个地方使 ...

  6. https多网站1个IP多个SSL证书的Apache设置办法

    这些天接触了解SSL证书后,写了一篇<申请免费的SSL证书,开通https网站>博文,其中简单记录了Apache的设置,后来又涉及到多个域名.泛域名解析.通配符SSL证书.单服务器/多服务 ...

  7. linux系统中使用socket直接发送ARP数据

    这个重点是如这样创建socket:  sock_send = socket ( PF_PACKET , SOCK_PACKET , htons ( ETH_P_ARP) ) ; 其后所有收发的数据都是 ...

  8. Spring核心

    方法区与常量池 BeanFactoryPostProcessor与BeanPostProcessor使用 创建pc过程 https://www.liangzl.com/get-article-deta ...

  9. log4j的添加顺序

    1.log4j的架包 <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api&l ...

  10. PHP单一文件入口框架简析

    <?php /** * PHP单一文件框架设计简析 * 1.MVC架构实现 * 2.URL路由原理 */ //URL路由原理 /** * 路由作用 * 获取url中的c和a变量,执行c类对应的方 ...