简体   繁体   中英

php shell_exec & permissions

I have the following directories:

/var/www/temp
/var/www/users (S3 mount)

the user which the following php is run on is www-data :

mkdir("temp/id247439757");
addSomeFilesInTheAboveDirectory();
shell_exec("temp/id247439757 users/id247439757");

the problem is that it's not moving the directory from temp/ to users/! All the files stay in the temp directory.

I think the user that executes shell_exec is www-data as well! how can I fix this? Please note that this problem cannot be addressed to the fact that it's a mounted directory as, if I directory do mkdir("users/id247439757") it does work.

您忘记了shell_exec调用中的“ mv”命令:

shell_exec("mv temp/id247439757 users/id247439757");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM