I have a PHP web page that builds a list of files from a particular directory.<br><br>In that PHP script I want to include some information about "what is using the file" (i.e ftp, gzip, cp etc.. so I code <br><br>

exec('/sbin/fuser -v $fpath/$fname',$answer,$retcode);<br><br>Retcode is always 1 (not in use, or a "fatal error" happened) and $answer is always empty<br><br>From root, in the directory I'm  interested in I use fuser -v * and it shows me a couple of in-use items<br>

(for testing I have a little loop that gzip/gunzip a rather large file)<br><br>I tried /sbin/fuser from my own id and get the same results as apache... that is, nothing useful.<br><br>So I thought AH HA!, use sudo in the PHP script...<br>

I got an error message from sudo saying a tty is required to use sudo even though I had that command set up to not require password.<br><br>Back to the drawing board...<br><br>How can I issue a command from a PHP script that will "run as root" to get the fuser results for me?<br>

<br>In some cases the file are chmod 600 root root in other cases 644 <regular user> <regular user><br><br>I want my web page thing to show me the files in-use... I can live without the 600 root-root files, but I really need to see the others.<br>

<br>Any suggestions?<br><br>Thank very much.<br>