I use this. It's ugly, but it works nicley. once you set your directories up.
function make_barcode($barcode)
{
$make_bc = "barcode -o /tmp/".$barcode.".ps -e 39 -b ".chr(39).$barcode.chr(39);
exec ($make_bc,$ret);
echo $make_bc.",".$ret[0]."<BR>";
$c_bc = "pstoimg -out /tmp/".$barcode.".gif -center 20 -density 100 -type gif -white -crop a /tmp/".$barcode.".ps";
exec ($c_bc,$ret);
echo $c_bc.",".$ret[0]."<BR>".$ret[1]."<BR>".$ret[2]."<BR>".$ret[3]."<BR>".$ret[4]."<BR>".$ret[5]."<BR>";
$c_c = "cp /tmp/".$barcode.".gif /home/inventory/public_html/bcimg/".$barcode.".gif";
exec ($c_c,$ret);
echo $c_c;
echo"<img src=bcimg/".$barcode.".gif>";
}