我正试图用easy deploy bundle部署我的symfony应用程序,但在第二步我遇到了一个错误:
| out :: /usr/bin/git
[OK] git command exists
[localhost] Executing command: cd /Users/marilou/Desktop/Kublay/kublay && which ssh
| out :: /usr/bin/ssh
[OK] ssh command exists
[kublayconc@ssh.cluster028.hosting.ovh.net] Executing command: echo 2021847078
kublayconc@ssh.cluster028.hosting.ovh.net's password:
| out :: 2021847078
[OK] The server allows to login via SSH from the local machine
[kublayconc@ssh.cluster028.hosting.ovh.net] Executing command: which /usr/local/bin/composer
kublayconc@ssh.cluster028.hosting.ovh.net's password:
In Process.php line 254:
[SymfonyComponentProcessExceptionProcessFailedException]
The command "ssh kublayconc@ssh.cluster028.hosting.ovh.net -p 22 'which /usr/local/bin/composer'" failed.
Exit Code: 1(General error)
Working directory: /Users/marilou/Desktop/Kublay/kublay
Output:
================
Error Output:
================
Exception trace:
at /Users/marilou/Desktop/Kublay/kublay/vendor/symfony/process/Process.php:254
SymfonyComponentProcessProcess->mustRun() at /Users/marilou/Desktop/Kublay/kublay/vendor/easycorp/easy-deploy-bundle/src/Task/TaskRunner.php:79
EasyCorpBundleEasyDeployBundleTaskTaskRunner->doRun() at /Users/marilou/Desktop/Kublay/kublay/vendor/easycorp/easy-deploy-bundle/src/Task/TaskRunner.php:38
EasyCorpBundleEasyDeployBundleTaskTaskRunner->run() at /Users/marilou/Desktop/Kublay/kublay/vendor/easycorp/easy-deploy-bundle/src/Deployer/AbstractDeployer.php:230
EasyCorpBundleEasyDeployBundleDeployerAbstractDeployer->checkRequirements() at /Users/marilou/Desktop/Kublay/kublay/vendor/easycorp/easy-deploy-bundle/src/Deployer/AbstractDeployer.php:143
EasyCorpBundleEasyDeployBundleDeployerAbstractDeployer->initialize() at /Users/marilou/Desktop/Kublay/kublay/vendor/easycorp/easy-deploy-bundle/src/Command/DeployCommand.php:78
EasyCorpBundleEasyDeployBundleCommandDeployCommand->execute() at /Users/marilou/Desktop/Kublay/kublay/vendor/symfony/console/Command/Command.php:255
SymfonyComponentConsoleCommandCommand->run() at /Users/marilou/Desktop/Kublay/kublay/vendor/symfony/console/Application.php:952
SymfonyComponentConsoleApplication->doRunCommand() at /Users/marilou/Desktop/Kublay/kublay/vendor/symfony/framework-bundle/Console/Application.php:87
SymfonyBundleFrameworkBundleConsoleApplication->doRunCommand() at /Users/marilou/Desktop/Kublay/kublay/vendor/symfony/console/Application.php:273
SymfonyComponentConsoleApplication->doRun() at /Users/marilou/Desktop/Kublay/kublay/vendor/symfony/framework-bundle/Console/Application.php:73
SymfonyBundleFrameworkBundleConsoleApplication->doRun() at /Users/marilou/Desktop/Kublay/kublay/vendor/symfony/console/Application.php:149
SymfonyComponentConsoleApplication->run() at /Users/marilou/Desktop/Kublay/kublay/bin/console:42
deploy [-c|--configuration CONFIGURATION] [--dry-run] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] [<stage>]
我试图在我的服务器上安装composer,但看起来它没有安装在易于部署的地方
Downloading...
Composer (version 1.9.1) successfully installed to: /home/kublayconc/composer
Use it: php composer
Some settings on your machine may cause stability issues with Composer.
If you encounter issues, try to change the following:
PHP was compiled with --enable-sigchild which can cause issues on some platforms.
Recompile it without this flag if possible, see also:
https://bugs.php.net/bug.php?id=22999
kublayconc@ssh01.cluster028.gra.hosting.ovh.net (php/7.2/production/stable) ~ $ php composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ / __ `__ / __ / __ / ___/ _ / ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
____/____/_/ /_/ /_/ .___/____/____/___/_/
/_/
Composer version 1.9.1 2019-11-01 17:20:17
看起来composer在服务器上安装得很好。有什么建议吗?
正如您在问题中提到的,EasyDeployBundle正在特定路径中寻找composer。在GitHub上快速搜索会显示路径的设置位置:src/Configuration/DefaultConfiguration.php
private $remoteComposerBinaryPath = '/usr/local/bin/composer';
基本上,您需要做的是调用$configuration->remoteComposerBinaryPath($remotePath)
,然后将您的composer二进制文件在$remotePath
(例如/home/kublayconc/composer
(中的实际位置传递给它,不幸的是,我对bundle的了解还不够,无法具体告诉您如何调用。