【发布时间】:2011-06-22 22:33:48
【问题描述】:
我正在为 github 创建一个部署脚本,用 PHP 编写。我正在使用shell_execcommand 运行git pull,它工作正常。
当拉取错误时,就会出现我的问题。如果我在终端中这样做,我会得到完整的错误。例如:
git pull origin master
Updating f706749..8468d24
test.txt: needs update
error: Entry 'test.txt' not uptodate. Cannot merge.
但是当我在shell_exec 中运行相同的命令时,输出被截断为只是
Updating f706749..8468d24
test.txt: needs update
错误消息被截断,可能是因为它是对先前响应的响应。有没有办法返回完整的输出?
【问题讨论】:
标签: php git shell-exec