Code: Select all
<?php
// Set the content-type
header("Content-type: image/png");
// Create the image
$im = imagecreatetruecolor(400, 30);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $black);
// The text to draw
$text = 'Testing...';
// Replace path by your own font path
putenv('GDFONTPATH=' . realpath('.'));
$font = 'Arial-Black.ttf';
// Add the text
imagettftext($im, 20, 0, 10, 20, $white, $font, $text);
imagepng($im);
imagedestroy($im);
?>And I narrowed it down to this line of codeThe image “http://localhost/shout/images/window.php” cannot be displayed, because it contains errors.
Code: Select all
imagettftext($im, 20, 0, 10, 20, $white, $font, $text);Here is my current configuration:
[/quote]./configure --disable-magic-quotes --enable-bcmath --enable-sockets --with-mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-gd --with-png --with-ttf --enable-gd-native-ttf --with-regex=system
Thanks,
John