ID: 27867 User updated by: andrej at antiszoc dot hu Reported By: andrej at antiszoc dot hu -Status: Feedback +Status: Open Bug Type: Program Execution Operating System: FreeBSD PHP Version: 4.3.5 New Comment:
<?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... Previous Comments: ------------------------------------------------------------------------ [2004-04-05 08:44:30] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [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