git pull Godaddy vs Bluehost的shell_exec配置 [英] shell_exec configuration for git pull Godaddy vs Bluehost

查看:269
本文介绍了git pull Godaddy vs Bluehost的shell_exec配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Github上有一个git pull web hook,在两个遥控器上,GoDaddy [production]和Bluehost [staging]上。这个问题不是关于这些公司本身,而是可能是设置差异的原因。

 <?php $ b $我有这个脚本,我已经设置为github.com上的post commit hook。 b $ output = shell_exec('git pull origin master'); 
echo< pre> $ output< / pre>;
?>

当我在Github repo上提交时,钩子在Bluehost上启动并正常工作。它不会对Godaddy做任何事情。

Bluehost浏览器响应:

   

Godaddy浏览器回应:

 <预>< /预>拉命令没有奏效。回购没有更新。 

当我通过浏览器运行这个脚本时:

 <?php 
$ output = shell_exec('ls');
echo< pre> $ output< / pre>;
?>

我在两台服务器上都得到正确的'ls'目录输出。



当我进入SSH目录时,我可以手动发出命令'git pull origin master',它可以在两台服务器上运行。那么这是否意味着Godaddy允许PHP发布一些命令,而不是其他的?我能以某种方式解决这个问题吗这不可能是真的,没有人会自动部署到Godaddy!

解决方案

这可能类似于以前的案例其中:


Godaddy技术支持已确认 php无法在其共享主机环境中访问git命令

他们表示需要使用VPS来实现此目的。


blockquote>

此评论确认您可以配置的php设置在共享服务器上非常有限。



因此,请检查Godaddy支持是否属实为您的设置。


I have a git pull web hook from Github, on two remotes, GoDaddy [production] and on Bluehost [staging]. This question isn't about those companies per se, but what could possibly be the reason for differences in the setups. I have this script, which I have setup as a post commit hook on github.com :

<?php
$output = shell_exec('git pull origin master');
echo "<pre>$output</pre>";
?>

When I commit on the Github repo, the hook fires and works fine on Bluehost. It doesn't do anything on Godaddy.

Bluehost browser response:

"already up to date". Pull command works, and the Bluehost repo is updated.

Godaddy browser response:

<pre></pre> Pull command has not worked. Repo not updated.

When I run this script via a browser:

<?php
$output = shell_exec('ls');
echo "<pre>$output</pre>";
?>

I get the proper 'ls' directory output on both servers.

When I SSH into the directory, I can manually issue the command 'git pull origin master' and it works on both servers. So does this just mean that Godaddy allows PHP to issue SOME commands, but not others? Can I fix this somehow? It can't be true that no one is automatically deploying into Godaddy!

解决方案

That could be similar to a previous case where:

Godaddy tech support confirmed that php does not have access to git commands in their shared hosting environment.
They said that VPS would be needed to achieve this.

This comment confirms that php settings (that you can configure) are very limited on a shared server.

So check with the Godaddy support if thatis the case for your setup.

这篇关于git pull Godaddy vs Bluehost的shell_exec配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆