简体   繁体   English

PHP的shell_exec和权限

[英]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 : 运行以下php的用户是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/! 问题在于它没有将目录从temp /移至users /! All the files stay in the temp directory. 所有文件都保留在temp目录中。

I think the user that executes shell_exec is www-data as well! 我认为执行shell_exec的用户也是www-data! 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. 请注意,这个问题不能得到解决的事实,这是一个安装目录,如果我做目录MKDIR(“用户/ id247439757”),它工作。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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