1

有一个运行 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] [--] [ [ [...]]]

哪里有问题?

4

1 回答 1

0

主机密钥验证失败。

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

那意味着$HOME不一样,并且$HOME/.ssh/known_hosts(用于验证远程主机的主机密钥)不存在或不一样。

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

于 2019-12-04T05:55:43.423 回答