باسلام من با تکه کد زیر در سایتم کد امنیتی میساختم اما روی هاست که آوردم کار نمیکنه
مشکل چیه؟

<?php

session_start();

$string = '';

for ($i = 0; $i < 4; $i++) {
// this numbers refer to numbers of the ascii table (lower case)
$string .= chr(rand(48, 57));
}

$_SESSION['rand_code'] = $string;

$dir = 'fonts/';

$image = imagecreatetruecolor(170, 60);
$black = imagecolorallocate($image, 0, 0, 0);
$color = imagecolorallocate($image, 100, 100, 90);
$white = imagecolorallocate($image, 255, 255, 255);

imagefilledrectangle($image,0,0,399,99,$white);
imagettftext ($image, 30, 0, 10, 40, $color, $dir."ALGER.ttf", $_SESSION['rand_code']);

header("Content-type: image/png");
imagepng($image);

?>