PHP Warning: imagettftext()

From: Date: Mon, 21 Jul 2008 17:14:52 +0000
Subject: PHP Warning: imagettftext()
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.general 
Request: Send a blank email to php-general+get-277152@lists.php.net to get a copy of this message
Hello, I'm trying to move a site over to the V5 of CentOS and I having problems with php/gd/freetype. It looks like my older systems which is running php-4.3.8-1.1, gd-2.0.15-1, freetype-2.1.4-5 can execute the code successfully. Now when I try to execute the same code on CentOS V5 with php-5.2.6, php-gd-5.2.6, gd-2.0.33-9.4, freetype-2.2.1-20 the same piece of code fails with the error: " *[Mon Jul 21 13:13:11 2008] [error] [client 137.203.140.206] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not read font in /www/html/template/lou2.php on line 10 [Mon Jul 21 13:13:11 2008] [error] [client 137.203.140.206] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not read font in /www/html/template/lou2.php on line 11 **"* I read through php.net and marc.info but I have not yet found a solution, Any ideas? Thanks, Lou code ============================ <?php //header("Content-type: image/png"); $im = imagecreate(400, 30); $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 128, 128, 128); $black = imagecolorallocate($im, 0, 0, 0); $text = 'BBBBBBBBBBBBBBBBBBBleh...'; $font = 'arial.ttf'; putenv( 'GDFONTPATH='.realpath('.') ); imagettftext($im, 20, 0, 11, 21, $grey, $font, $text); imagettftext($im, 20, 0, 10, 20, $black, $font, $text); header("Content-type: image/png"); imagepng($im); imagedestroy($im); ?>


« previous php.general (#277152) next »