When using imagepsbbox, you are probably trying to do something like creating a button with text, so that the button is large enough for the text...
Below is a very simple example of making a black button just big enough to display white text on it.
<?php
if (!$text)
$text = "This is a sample text";
$fontsize=14;
$font=ImagePsLoadFont("/fonts/ariam___.pfb");
list($lx,$ly,$rx,$ry) = imagepsbbox($text,$font,$fontsize,0,0,0);
$textwidth = $rx - $lx;
$textheight = $ry - $ly;
$imh = $textheight + 20;
$imw = $textwidth + 40;
$im = imageCreate( $imw, $imh );
$black = ImageColorAllocate ($im, 0, 0, 0);
$white = ImageColorAllocate ($im, 255, 255, 255);
ImagePSText ($im, "$text", $font, $fontsize, $white, $white, 20, 20,'','','',4);
header("Content-type: image/jpeg");
ImageJPEG ($im,"",100);
Imagepsfreefont ( $font );
ImageDestroy ( $im );
?>