Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php shell_exec作为另一个用户_Php_Shell_Permissions_Ubuntu 14.04 - Fatal编程技术网

php shell_exec作为另一个用户

php shell_exec作为另一个用户,php,shell,permissions,ubuntu-14.04,Php,Shell,Permissions,Ubuntu 14.04,我使用的是Ubuntu14.04,当我使用terminal执行某些命令时,确实可以正常工作,但当使用php执行相同的命令时,我得到了错误: Can't read license data (-102) Permission denied (errno: 13) 在终端我写: /path/to/file$ ./rlmsign file.txt 和rlmsign在file.txt中写入内容。在php shell_exec中使用时: $output = shell_exec('/path/to/f

我使用的是Ubuntu14.04,当我使用terminal执行某些命令时,确实可以正常工作,但当使用php执行相同的命令时,我得到了错误:

Can't read license data (-102)
Permission denied (errno: 13)
在终端我写:

/path/to/file$ ./rlmsign file.txt
和rlmsign在file.txt中写入内容。在php shell_exec中使用时:

$output = shell_exec('/path/to/file ./rlmsign file.txt');

我上面有个错误。当我回显用户时,我也会得到www数据。我想这是权限方面的问题,但是我的file.txt对所有用户、组和其他用户都有读写权限。somenone能给我一些建议吗?

检查此文件的父目录路径。因为你可以遍历一个目录,只要你对它有执行权限。您可以在此处阅读更多内容:查看谁使用ls拥有该文件,并在需要时对其进行更改chown.owner是我,我尝试将所有者更改为www数据,但没有成功。是的,但apache是否与您一样运行?如何检查?我认为apache可以作为www数据运行。