【问题标题】:Apache ant working in root not in shell_execApache ant 在 root 中工作而不是在 shell_exec
【发布时间】:2012-05-31 21:03:48
【问题描述】:

我在 Apache ant 中遇到问题 所有命令都在 ssh 客户端腻子中工作 但是当我尝试在 shell_exec 中运行时,它给出了错误

sh: ant: command not found

shell_exec中是否有权限使用

我对服务器有根访问权限

【问题讨论】:

  • 运行网络服务器的用户是否有权运行ant?

标签: php shell ant ssh putty


【解决方案1】:

PHP 是否尊重您的环境路径?您可能需要限定可执行文件的路径。有关更多路径/shell 信息,请参阅此帖子:PHP exec $PATH variable missing elements

【讨论】:

  • 如果你尝试运行:exec('echo $PATH') 是你的 ant 可执行文件的路径吗?
  • ant path is not there that is the response /sbin:/usr/sbin:/bin:/usr/bin
  • 你解决了这个问题吗?您可能需要在 shell_exec 中完全限定 ant 可执行文件的路径
  • 很高兴它对你有用。如果您的问题得到解决,请随时接受此答案。
猜你喜欢
  • 1970-01-01
  • 2018-12-29
  • 1970-01-01
  • 1970-01-01
  • 2014-08-17
  • 2014-09-02
  • 1970-01-01
  • 1970-01-01
  • 2013-05-27
相关资源
最近更新 更多