为什么在 运行 一个 shell 脚本时给予权限被拒绝?
Why it is giving permission denied while running a shell script?
执行后
frama-c -pdg -dot-pdg graph -pdg-print test.c
在 shell_script 到 php 文件中。在直接执行上述命令时,我得到的输出是 graph.main.dot 的权限被拒绝,我得到了正确的输出。
因为当您 运行 它时,您是从您的用户帐户 运行 下载它,而当 PHP 运行 使用它时,它是 运行从网络服务器帐户中获取它。
您有权访问 graph.main.dot
但网络服务器没有。
您可以使用 chmod
和 chgrp
命令更改权限。
执行后
frama-c -pdg -dot-pdg graph -pdg-print test.c
在 shell_script 到 php 文件中。在直接执行上述命令时,我得到的输出是 graph.main.dot 的权限被拒绝,我得到了正确的输出。
因为当您 运行 它时,您是从您的用户帐户 运行 下载它,而当 PHP 运行 使用它时,它是 运行从网络服务器帐户中获取它。
您有权访问 graph.main.dot
但网络服务器没有。
您可以使用 chmod
和 chgrp
命令更改权限。