freetype2

PHP Fatal error: Call to undefined function imagettftext()

妖精的绣舞 提交于 2019-11-27 20:03:42
Why am I getting the error PHP Fatal error: Call to undefined function imagettftext() on line 29? <?php ob_start(); session_start(); $strings = '123456789'; $i = 0; $characters = 6; $code = ''; while ($i < $characters) { $code .= substr($strings, mt_rand(0, strlen($strings)-1), 1); $i++; } $_SESSION['captcha'] = $code; //generate image $im = imagecreatetruecolor(124, 40); $foreground = imagecolorallocate($im, 0, 0, 0); $shadow = imagecolorallocate($im, 173, 172, 168); $background = imagecolorallocate($im, 255, 255, 255); imagefilledrectangle($im, 0, 0, 200, 200, $background); // use your own