【问题标题】:imagettfbbox() Cant Open .ttf font [closed]imagettfbbox()无法打开.ttf字体[关闭]
【发布时间】:2013-09-13 16:34:25
【问题描述】:

我有这个错误:

致命错误: 调用未定义的函数 imagettfbbox() /home/example/public_html/generate.php 上线 65

generate.php 的第 65 行

63- $code = $this->generateCode();

64- $font = _ROOT_PATH_ . '/Captcha/ccf.ttf';

65- imagettfbbox(138, 0, $font, $code);

请帮帮我:(

【问题讨论】:

标签: php


【解决方案1】:

根据 http://php.net/manual/en/function.imagettfbbox.php

 This function requires both the GD library and the » FreeType library. 

您必须在 PHP 构建中缺少一个或两个必需的库。

使用此代码构建文件“info.php”:

<?php phpinfo() ?>

运行它,看看缺少哪些,然后去安装它/它们。

【讨论】:

  • TY EmRa 为您提供帮助 :)
【解决方案2】:

要使用“imagettfbbox”功能,必须同时具有 GD 和 FreeType。看来,鉴于其中一个错误丢失了。

PHP.net imagettfbbox docs

一旦它们都可用,该功能应该可以工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-21
    • 2018-09-27
    • 1970-01-01
    • 2013-03-03
    • 2014-07-07
    • 1970-01-01
    • 1970-01-01
    • 2016-12-03
    相关资源
    最近更新 更多