【发布时间】:2021-10-30 00:09:56
【问题描述】:
我有一个简单的 PHP 脚本:
$output = shell_exec('git pull https://****@bitbucket.org/****/****.git 2>&1');
print_r($output)
我可以通过 SSH 连接到我的主机并使用“PHP scriptname.php”运行它,它运行良好,并在几分之一秒内告诉我一切都是最新的。
但是,当我尝试通过网络浏览器运行相同的 PHP 脚本时,它会无限期挂起。
【问题讨论】:
-
使用 `/usr/bin/php -c "path/to/file.sh" 检查 .sh 文件的输出,看它是否抛出错误。
标签: php linux git web-hosting