The earlier posted code has a small bug in it: it uses bzerror instead of bzerrno. Should be like this:
$fh = bzopen('file.bz2','r');
while(!feof($fh)) {
$buffer = bzread($fh);
if($buffer === FALSE) die('Read problem');
if(bzerrno($fh) !== 0) die('Compression Problem');
}
bzclose($fh);