hankknight
asked on
PHP/GD2: undefined function imagettftext()
Hello,
I have a PHP script that works perfectly on one server but causes a fatal error on another:
Fatal error: Call to undefined function imagettftext() on line 8
Both have GD2 installed. I use PHP 5.2.4. Any ideas why this is not working? Here is my script:
<?php
print_r (better_imagettfbbox ('12', '44', 'arial.ttf', 'Hello World'));
function better_imagettfbbox($size, $angle, $font, $text) {
$dummy = imagecreate(1, 1);
$black = imagecolorallocate($dummy, 0, 0, 0);
$bbox = imagettftext($dummy, $size, $angle, 0, 0, $black, $font, $text);
imagedestroy($dummy);
return $bbox;
}
?>
I have a PHP script that works perfectly on one server but causes a fatal error on another:
Fatal error: Call to undefined function imagettftext() on line 8
Both have GD2 installed. I use PHP 5.2.4. Any ideas why this is not working? Here is my script:
<?php
print_r (better_imagettfbbox ('12', '44', 'arial.ttf', 'Hello World'));
function better_imagettfbbox($size,
$dummy = imagecreate(1, 1);
$black = imagecolorallocate($dummy,
$bbox = imagettftext($dummy, $size, $angle, 0, 0, $black, $font, $text);
imagedestroy($dummy);
return $bbox;
}
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.