I use PHP in Linux with Apache, and have the same problem when I use ex:
ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, "arial.ttf", $text);
(file .php same dir with .ttf)
but if I use absolutely .ttf path:
ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, "/usr/local/apache/htdocs/arial.ttf", $text);
->it works!
I don't know why.