Use this to set a term environment before calling su... some unix command need a TERM env.:
from: http://php.us.themoes.org/manual/en/function.exec.php
<?php
exec('TERM=xterm /usr/bin/top n 1 b i', $top, $error );
echo nl2br(implode("\n",$top));
if ($error){
exec('TERM=xterm...