Originally posted by diego25
Are you really sure? Well, I don't have a Unix server with PHP at hand right now, so I can't test it...
Ok, so use grep (the unix command) to remove the error messages then.
Diego
100% sure , if I execute this code ,
<?
ob_start();
@passthru("/usr/bin/du -sk /home/test/");
$spacea = ob_get_contents();
ob_end_clean();
$spaceb = ereg_replace ("/home/test", "", $spacea);
$spaceb = str_replace(' ','',$spaceb);
$spacec = $spaceb/1024;
$spaced = number_format($spacec, 3, ',', ' ');
?>
.. look there is no echo in the code , I receive this
/usr/bin/du: `/home/test/catalogs/test/session/Z': Permission denied
while if I insert a echo "$spaced MB" at the end.......
<?
ob_start();
@passthru("/usr/bin/du -sk /home/test/");
$spacea = ob_get_contents();
ob_end_clean();
$spaceb = ereg_replace ("/home/test", "", $spacea);
$spaceb = str_replace(' ','',$spaceb);
$spacec = $spaceb/1024;
$spaced = number_format($spacec, 3, ',', ' ');
echo "$spaced MB";
?>
I receive this
/usr/bin/du: `/home/test/catalogs/test/session/Z': Permission denied
4,984 MB