ID:               27867
 Updated by:       [EMAIL PROTECTED]
 Reported By:      andrej at antiszoc dot hu
-Status:           Open
+Status:           Bogus
 Bug Type:         Program Execution
 Operating System: FreeBSD
 PHP Version:      4.3.5
 New Comment:

I can not reproduce this within Linux. (in which -d argument does not
exist..) And I can't reproduce this in FreeBSD either. So it must be
something wrong elsewhere in your script /system.




Previous Comments:
------------------------------------------------------------------------

[2004-04-05 08:56:02] andrej at antiszoc dot hu

<?PHP

  $dirname = 'andrej'; //or the local one

  $usedspace = exec('du -d 0 -h /home/'.$dirname);

  print $usedspace;

/*check what you got for the above command in shell... not that in
$usedspace*/

?>



So... but you have to try the same command from shell. I didn't post
any code sample before, because it could be very system specific (e.g:
dir. struct.). I hoped, you can reproduce it, from what I have posted
for the first time. Of coz it's FULLY pointless to post our script,
because it's system specific, and uses SQL, and mails the output...

------------------------------------------------------------------------

[2004-04-05 07:09:59] andrej at antiszoc dot hu

Description:
------------
We are using a script, which looks up every directory of our webhosting
customers. For some reasons we don't use quota, just looks the space,
the customers use. The script executes du, width exec('du -d 0 -h
/MAINDIR'.dirname); this worked just fine, for weeks. Last week we
update-ed to PHP4.3.5 and after, the script emailed us very wierd
numbers. Taking a closer look we saw, that with exec() du returns
exactly the twice of the real du value, but everything else fine. We
tested it from directly in the shell, and of coz several times, in our
PHP script.



This a very simple thing, so wouldn't post any code samples.



P.S: I've just tried stat, it worked far more worse...



Thx,

Andrej



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27867&edit=1

Reply via email to