php captcha cannot load when upload to server
<p>Regarding captcha In local PC is working fine but when upload to server (CentOS5.5)</p>

<p>PHP captcha cannot load.</p>

<p>This is php code call get_captcha.php:</p>

<pre><code>$('#captcha-refresh').click(function() {  
  change_captcha();
});

function change_captcha()
{           
  document.getElementById('captcha').src="get_captcha.php?rnd=" + Math.random();
}
</code></pre>

<p>get_captcha.php:</p>

<pre><code>for ($i = 0; $i &lt; 4; $i++) 
{
    $word_1 .= chr(rand(97, 122));
}
for ($i = 0; $i &lt; 4; $i++) 
{
    $word_2 .= chr(rand(97, 122));
}

$_SESSION['random_number'] = $word_1.' '.$word_2;
$dir = 'fonts/';
$image = imagecreatetruecolor(165, 50);
$font = "recaptchaFont.ttf"; // font style
$color = imagecolorallocate($image, 0, 0, 0);// color
$white = imagecolorallocate($image, 255, 255, 255); // background color white
imagefilledrectangle($image, 0,0, 709, 99, $white);
imagettftext ($image, 22, 0, 5, 30, $color, $dir.$font, $_SESSION['random_number']);
header("Content-type: image/png");
imagepng($image);  
$_SESSION['random_numberafter'] = $_SESSION['random_number'];
</code></pre>
