我在github上有兩個遠程的git pull web hook,GoDaddy [production]和Bluehost [staging]。這個問題不是關於這些公司本身,而是可能是設置差異的原因。我有這個劇本,我已經安裝作爲後提交上github.com鉤:shell_exec git pull配置Godaddy vs Bluehost
<?php
$output = shell_exec('git pull origin master');
echo "<pre>$output</pre>";
?>
當我承諾在Github上回購,鉤火災和BlueHost的正常工作。它不會對Godaddy做任何事情。
BlueHost的瀏覽器響應:
"already up to date". Pull command works, and the Bluehost repo is updated.
Godaddy的瀏覽器響應:
<pre></pre> Pull command has not worked. Repo not updated.
當我運行通過瀏覽器這個腳本:
<?php
$output = shell_exec('ls');
echo "<pre>$output</pre>";
?>
獲得正確的 'LS' 目錄在兩臺服務器上輸出。
當我進入SSH目錄時,我可以手動發出命令'git pull origin master',它可以在兩臺服務器上運行。那麼這是否意味着Godaddy允許PHP發佈一些命令,而不是其他的?我能以某種方式解決這個問題嗎沒有人會自動部署到Godaddy中!
呢'shell_exec'執行什麼呢?像'echo'或'ls'? – sobolevn
godaddy或VPS共享的主機? – Doon