php - 调用未定义函数 imagettftext()
问题描述
我没有使用 PHP 的经验,但我试图在我的 macOS Sierra High 10.13.2 上运行一个 php 文件。我收到此错误:
Call to undefined function imagettftext()
我安装了 GD 和 Freetype。问题是什么?
for ( $i = 0; $i < strlen( $word ); $i++ ) {
$font = $this->fonts[array_rand( $this->fonts )];
$font = $this->normalize_path( $font );
imagettftext( $im, $this->font_size, mt_rand( -12, 12 ), $x,
$this->base[1] + mt_rand( -2, 2 ), $fg, $font, $word[$i] );
$x += $this->font_char_width;
}
解决方案
推荐阅读
- python - Firestore 无法获取路径快照
- java - 如何在 Lambda 表达式中定义 Intent
- python - 数据框无法填充熊猫中的 NaN 值
- ruby - 使用 gem 时 main:Object 的未定义方法错误
- java - Java 在读取文件但同时使用流时避免 java.lang.OutOfMemoryError
- selenium - 关联/组合 2 个不同的 xpath Java Selenium
- xamarin.android - 具有私有嵌套接口的 Xamarin 绑定库
- visual-studio-code - VSCode:如何撤消分屏并仅显示当前文件?
- html - 使 :hover 适用于填充以及主要内容区域
- mysql - 远程 mysql 连接在工作台中有效,但在 python 中无效