我正在使用 imagettftext() 函数来创建自定义验证码脚本。
我已经在我的 PC 上成功运行并测试了代码,运行 PHP(版本 5.3.8),但是当我上传到运行 PHP(版本 5.2.17)的共享主机帐户时,出现以下错误
Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/pheelco/public_html/captcha.php on line 17
这是第 17 行;
imagettftext($img, 25, 0, 0, 25, $text, "fonts/alger.ttf", $num);
我肯定有使用该字体上传的文件夹“字体”,它位于 public_html 文件夹中。
有任何想法吗?
注意:我无权更改任何 PHP 配置,因为我使用的是共享主机帐户。