Who owns the tar tar tar exp file?
Regarding file permissions, when you use a php script to unzip a tar file, who is the user of the file owner?
I am wondering if my ftp user is mine because I downloaded the script file? Or does apache own the file? I know their flags are set to keep the original permissions which I don't want (files created and archived by someone else). I want my user to be the creator / owner of the files.
PS Its a cloudy environment. Below is the code I downloaded. I accomplished by visiting the page in a browser. I can change the permissions on files in Dreamweaver ... Does that mean I'm the owner?
exec('wget http://wordpress.org/latest.tar.gz');
exec('tar -xzvf latest.tar.gz');
source to share
You can do echo shell_exec('whoami');
And this will output the username. For me, he deducedapache
And yes, apache will own the files. For example, if you do something like this as root:
root@localhost# cp /home/user/foo /home/user/foo2
root@localhost# ls -l /home/user
-rw-rw-r-- 1 user user 232 Apr 12 12:00 foo
-rw-rw-r-- 1 root root 232 Apr 12 12:01 foo2
source to share