【问题标题】:How to run Satis on a remote server?如何在远程服务器上运行 Satis?
【发布时间】:2020-03-28 21:07:23
【问题描述】:

有一个命令可以运行Satis:php bin/satis build satis.json response

Satis 本身位于服务器上,例如example.com/satis

如何远程在服务器上运行命令?

我尝试使用命令shell_exec('php bin/satis build satis.json response/') 编写脚本,但在Satis 无法登录Git 时遇到错误:

Scanning packages
Failed to clone the git@gitlab.com:project/project.git repository, try running in interactive mode so that you can enter your credentials

In Git.php line 354:

  Failed to execute git clone --mirror 'git@gitlab.com:project/project
  .git' '/var/www/.composer/cache/vcs/git-gitlab.com-project.git/'                                                                         

  Cloning into bare repository '/var/www/.composer/cache/vcs/git-gitlab.com-project.git'...                                                
  Host key verification failed.                                                
  fatal: Could not read from remote repository.                                

  Please make sure you have the correct access rights                          
  and the repository exists.                                                   


build [--repository-url [REPOSITORY-URL]] [--repository-strict] [--no-html-output] [--skip-errors] [--stats] [--] [ [ [...]]]

哪里出了问题?

【问题讨论】:

标签: git ssh composer-php satis


【解决方案1】:

主机密钥验证失败。

您的命令可能不是由与服务器上管理满意的用户相同的用户执行的。

也就是说$HOME不一样,$HOME/.ssh/known_hosts(用来验证远程主机的主机密钥)不存在或者不一样。

至少尝试shell_exec('id -a; env') 以检查通过shell_exec() 调用看到的用户/环境。

【讨论】:

    猜你喜欢
    • 2016-10-25
    • 2015-12-23
    • 2021-06-06
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-08
    相关资源
    最近更新 更多