ID: 45326 Updated by: [EMAIL PROTECTED] Reported By: erickivuti at gmail dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Linux PHP Version: 5.2CVS-2008-06-21 (snap) -Assigned To: +Assigned To: pajoye New Comment:
You have to compile PHP-GD with Freetype support (--with-freetype-dir=/usr for example). Previous Comments: ------------------------------------------------------------------------ [2008-06-21 10:31:52] erickivuti at gmail dot com Description: ------------ I am using a catpha script on my site. The script works fine at home (EasyPHP 2 on WinXP). Once I upload to a host server, I get the error, given below. The code was obtained from a captcha plugin for Dreamweaver. I have created a file with phpinfo(); at: http://smartpetitions.com/info.php The page is: http://smartpetitions.com/create.php I have checked the reported bugs: http://bugs.php.net/bug.php?id=19542 http://bugs.php.net/bug.php?id=21028 Reproduce code: --------------- <?php // create.php //...MISSING CODE.. function CaptchaImage($width='120',$height='30',$characters='6',$hex_bg_color='FFFFFF',$hex_text_color="FF0000",$hex_noise_color="CC0000", $img_file='captcha.jpg') { //...MISSING CODE.. /* create textbox and add text */ $textbox = imagettfbbox($font_size, 0, $this->font, $code); // LINE 57 $x = ($width - $textbox[4])/2; $y = ($height - $textbox[5])/2; imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code); /* save the image */ //...MISSING CODE.. } ?> <!-----MISSING CODE-----------> <td><div style="border:1px solid gray; padding:5px 5px; width:200px; text-align:center;"> <?php $captcha = new CaptchaImage(150,50,5,'FFFFFF','003366','0099CC');?> <img src="/images/refresh.gif" title="Refresh Code" onclick="captcha()" /><br /> <div style="padding:4px 0px;">Enter the code and click 'Create':</div> <!-----MISSING CODE-----------> Expected result: ---------------- Just like this page. A verification code. The code on the page works fine when tested offline on EasyPHP, Wamp or Xampp, on multiple PC's. Actual result: -------------- Fatal error: Call to undefined function imagettfbbox() in /home/smartpet/public_html/create.php on line 57 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45326&edit=1
