ada*_*tle 1 php git shell-exec
我正在用PHP编写的github创建部署脚本.我正在使用shell_exec命令运行git pull哪个工作正常.
拉出错误时会出现问题.如果我在终端中执行此操作,则会收到完整错误.例如:
git pull origin master
Updating f706749..8468d24
test.txt: needs update
error: Entry 'test.txt' not uptodate. Cannot merge.
Run Code Online (Sandbox Code Playgroud)
但是当我在shell_exec输出中运行相同的命令被截断为just
Updating f706749..8468d24
test.txt: needs update
Run Code Online (Sandbox Code Playgroud)
错误消息正在被切断,可能是因为它是来自先前响应的响应.有没有办法返回完整的输出?
10-1缺少的行不是写入stdout而是写入stderr.
在这种情况下,你可以重定向标准错误到标准输出与
"command 2>&1"
Run Code Online (Sandbox Code Playgroud)
的2>&1重定向错误消息到正常输出文件.
| 归档时间: |
|
| 查看次数: |
1981 次 |
| 最近记录: |