PHP 文件未在提交后执行
我在提交后有这个:
#!/bin/sh
REPOS="$1"
REV="$2"
/usr/bin/php /home/name/svn/scripts/post-commit.php $REPOS $REV
但无论我做什么,post-commit.php 都没有被执行,即使使用 chmod a+rw 也没有执行。 exec 也没有输出。
我缺少什么?
更新:删除了 exec > ./logs/log.txt 来自此示例,因为它似乎让人感到困惑。
I have this in post-commit:
#!/bin/sh
REPOS="$1"
REV="$2"
/usr/bin/php /home/name/svn/scripts/post-commit.php $REPOS $REV
But whatever I do, post-commit.php isn't being executed, not even with a chmod a+rw on it. Also there is no output from exec.
What am I missing?
Update: removed exec > ./logs/log.txt from this example since it seems to confuse people.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试:
另外,验证您的后脚本在手动执行时是否正常工作。
try:
Also, verify that your post script works fine when executed by hand.
exec
替换当前的 shell 进程,并且不会启动新的 shell 进程。因此,在执行exec
命令之后,您的 shell 将停止。顺便说一句,你的特定
exec
命令的目的让我困惑......所以只需删除它,你应该没问题。exec
replaces the current shell process, and doesn't start a new one. So after theexec
command, your shell stops.The purpose of your particular
exec
command eludes me by the way ... So just remove it and you should be fine.你最好先执行 'cd' 到你真正想要 shell 执行的目录。
我不确定运行此命令时 SVN 的路径,但当然你的脚本有潜在的权限问题
you'd better to exec a 'cd' first, to a directory where you really want the shell to execute.
i'm not sure the path SVN will have when running this, but of course your script have potential privilege problems