有一个命令可以运行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] [--] [ [ [...]]]问题出在哪里?
发布于 2019-12-04 13:55:43
主机密钥验证失败。
执行您的命令的用户可能与在服务器上管理satis的用户不同。
这意味着$HOME不同,而$HOME/.ssh/known_hosts (用于验证远程主机的主机密钥)不在那里或不同。
至少尝试使用shell_exec('id -a; env')来查看通过shell_exec()调用看到的用户/环境。
https://stackoverflow.com/questions/59169654
复制相似问题