小编ada*_*tle的帖子

在PHP中使用shell_exec运行'git pull'不显示错误

我正在用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)

错误消息正在被切断,可能是因为它是来自先前响应的响应.有没有办法返回完整的输出?

php git shell-exec

1
推荐指数
1
解决办法
1981
查看次数

标签 统计

git ×1

php ×1

shell-exec ×1