Error

Call to undefined function imagettfbbox()

/home/xxx/domains/survey.domain.com/public_html/application/extensions/captchaExtended/CaptchaExtendedAction.php(471)

459         imagecolordeallocate($image,$backColor);
460 
461         if($this->transparent){
462             imagecolortransparent($image,$backColor);
463         }
464 
465         if($this->fontFile === null){
466             $this->fontFile = realname(Yii::app()->basePath."/../assets/fonts/font-src/lato-v11-latin-700.ttf");
467             
468         }
469 
470         $length = strlen($code);
471         $box = imagettfbbox(25,0,$this->fontFile,$code);
472         $w = $box[4] - $box[0] + $this->offset * ($length - 1);
473         $h = $box[1] - $box[5];
474         $scale = min(($this->width - $this->padding * 2) / $w,($this->height - $this->padding * 2) / $h);
475         $x = 10;
476         $y = round($this->height * 27 / 40);
477 
478         $r = (int)($this->foreColor % 0x1000000 / 0x10000);
479         $g = (int)($this->foreColor % 0x10000 / 0x100);
480         $b = $this->foreColor % 0x100;
481         $foreColor = imagecolorallocate($image, mt_rand($r-50,$r+50), mt_rand($g-50,$g+50),mt_rand($b-50,$b+50));
482 
483         for($i = 0; $i < $length; ++$i){

Stack Trace

#0
+
 /home/xxx/domains/survey.domain.com/public_html/application/extensions/captchaExtended/CaptchaExtendedAction.php(143): CaptchaExtendedAction->renderImage()
138                     'hash1'=>$this->generateValidationHash($result),
139                     'hash2'=>$this->generateValidationHashCI($result),
140                     'url'=>$this->getController()->createUrl($this->getId(),array('v' => uniqid())),
141                 ));
142             }else{
143                 $this->renderImage($this->getVerifyCode());
144             }
145         }
146         Yii::app()->end();
147     }
148 
#8
+
 /home/xxx/domains/survey.domain.com/public_html/index.php(182): CApplication->run()
177 require_once APPPATH . 'core/LSYii_Application' . EXT;
178 
179 $config = require_once(APPPATH . 'config/internal' . EXT);
180 
181 Yii::$enableIncludePath = false;
182 Yii::createApplication('LSYii_Application', $config)->run();
183 
184 /* End of file index.php */
185 /* Location: ./index.php */
2020-04-09 12:15:59 Apache Yii Framework/1.1.22-dev