[英]PHP shell_exec permissions in nginx
echo shell_exec('ls');
works fine. 工作正常。
But trying to copy something: 但是尝试复制一些东西:
echo shell_exec('cp index.php temp/index.php');
It doesnt show any error, but it doesnt copy. 它不会显示任何错误,但是不会复制。 I am using nginx with phpcgi. 我在phpcgi中使用nginx。
Try to change the perms of the temp folder. 尝试更改临时文件夹的权限。 Example: 例:
chmod 777 temp chmod 777温度
OR 要么
Check the user you are running shell_exec with and grant him perms to write to temp folder: 检查正在运行shell_exec的用户,并授予他权限以写入temp文件夹:
echo shell_exec('whoami'); 回声shell_exec('whoami');
Try these two commands. 试试这两个命令。
chmod -R 777 /path/of/your/app
chown -R apache:apache path/of/your/app
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.