#45326 [NEW]: Call to undefined function imagettfbbox()
| From: | erickivuti at gmail dot com | Date: | Sat, 21 Jun 2008 10:31:53 +0000 |
| Subject: | #45326 [NEW]: Call to undefined function imagettfbbox() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-125932@lists.php.net to get a copy of this message | ||
From: erickivuti at gmail dot com
Operating system: Linux
PHP version: 5.2CVS-2008-06-21 (snap)
PHP Bug Type: Unknown/Other Function
Bug description: Call to undefined function imagettfbbox()
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 bug report at http://bugs.php.net/?id=45326&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45326&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45326&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45326&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45326&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45326&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45326&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45326&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45326&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45326&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45326&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45326&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45326&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45326&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45326&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45326&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45326&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45326&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45326&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45326&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45326&r=mysqlcfg