|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-04-05 07:09 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 09:00:02 2025 UTC |
<?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...