| Q | A |
| --- | --- |
| Issue Type | Question |
| Deployer Version | Using .phar version, 3.3.0 |
| Local Machine OS | Windows 7 |
| Remote Machine OS | Debian 8 |
I can't connect to my server with Deployer, but "normal SSH" connexion is working (through Git Bash, OpenSSH, Putty...).
deploy.php<?php
require 'recipe/symfony.php';
set('ssh_type','ext-ssh2');
server('preprod', 'XX.XX.XX.XXX')
->user('user')
->configFile('C:/Users/user/.ssh/config')
->stage('production')
->env('deploy_path', '/var/www/path/www');
set('repository', 'https://[email protected]/user/repo.git');
$ php deployer.phar deploy preprod -vvv
ΓΓΓ± Executing task β[32mdeploy:prepareβ[39m
ΓΓ₯β on [preprod]
β[31m>β[39m echo $0
Warning: ssh2_connect(): Unable to connect to XX.XX.XX.XXX on port 22 in phar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Session.php o
n line 153
Warning: ssh2_connect(): Unable to connect to XX.XX.XX.XXX in phar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Session.php on line 153
β[37;41m β[39;49m
β[37;41m Shell on your server is not POSIX-compliant. Please change to sh, bash or similar. β[39;49m
β[37;41m Usually, you can change your shell to bash by running: chsh -s /bin/bash β[39;49m
β[37;41m β[39;49m
β[37;41m β[39;49m
β[37;41m [RuntimeException] β[39;49m
β[37;41m The SSH connection failed. β[39;49m
β[37;41m β[39;49m
β[33mException trace:β[39m
() at β[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Session.php:134β[39m
Ssh\Session->createResource() at β[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/AbstractResourceHolder.php:25β[39m
Ssh\AbstractResourceHolder->getResource() at β[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Subsystem.php:39β[39m
Ssh\Subsystem->getSessionResource() at β[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Exec.php:18β[39m
Ssh\Exec->createResource() at β[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/AbstractResourceHolder.php:25β[39m
Ssh\AbstractResourceHolder->getResource() at β[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Exec.php:24β[39m
Ssh\Exec->run() at β[32mphar://C:/wamp/www/repo/deployer.phar/src/Server/Remote/SshExtension.php:116β[39m
Deployer\Server\Remote\SshExtension->run() at β[32mphar://C:/wamp/www/repo/deployer.phar/src/functions.php:296β[39m
run() at β[32mphar://C:/wamp/www/repo/deployer.phar/recipe/common.php:110β[39m
{closure}() at β[32mn/a:n/aβ[39m
call_user_func() at β[32mphar://C:/wamp/www/repo/deployer.phar/src/Task/Task.php:79β[39m
Deployer\Task\Task->run() at β[32mphar://C:/wamp/www/repo/deployer.phar/src/Executor/SeriesExecutor.php:43β[39m
Deployer\Executor\SeriesExecutor->run() at β[32mphar://C:/wamp/www/repo/deployer.phar/src/Console/TaskCommand.php:82β[39m
Deployer\Console\TaskCommand->execute() at β[32mphar://C:/wamp/www/repo/deployer.phar/vendor/symfony/console/Command/Command.php:256β[39m
Symfony\Component\Console\Command\Command->run() at β[32mphar://C:/wamp/www/repo/deployer.phar/vendor/symfony/console/Application.php:791β[39m
Symfony\Component\Console\Application->doRunCommand() at β[32mphar://C:/wamp/www/repo/deployer.phar/vendor/symfony/console/Application.php:186β[39m
Symfony\Component\Console\Application->doRun() at β[32mphar://C:/wamp/www/repo/deployer.phar/vendor/symfony/console/Application.php:117β[39m
Symfony\Component\Console\Application->run() at β[32mphar://C:/wamp/www/repo/deployer.phar/src/Deployer.php:101β[39m
Deployer\Deployer->run() at β[32mphar://C:/wamp/www/repo/deployer.phar/bin/dep:63β[39m
require() at β[32mC:\wamp\www\repo\deployer.phar:4β[39m
β[32mdeploy [-p|--parallel]β[39m
@elfet This seems like an ssh2 extension bug
@oanhnn Has this bug been reported to ssh2 developers?
@bilougit https://bugs.php.net/bug.php?id=60436
Do I have another solution to connect to my server in the meantime?
Is there any solution for this problem? Or is that mean that ext-ssh2 doesn't work in deployer?
It's working. In Deployer v4 you can use native ssh implementation.
Is v4 released ? The doc/website still mention v3.3.
And if yes, what is the correct setup to use the native SSH ? The doc has not been updated or so it seems.
Many thanks!
v4 in still in progress. Will be releases soon i hope.
Ok thanks! Can't wait, still using the old version of Capifony here...
If you want to support Deployer development you can become backer on https://www.patreon.com/deployer
Still doesn't work for me in 4.0.1 :/
@sebastianlp
What is method you used? ssh2, phpseclib or native ssh ?
Can you try with other method?
You can close it, now it's working with native ssh.
Cool.
I have the same issue.
and I find out echo $0 will output '-bash'.
yes, with leading "-".
using native ssh and deployer 4.2.1
but phpseclib is okay.
I'm having this issue too. Has is been resolved and if so, how?
closed but no comment on how to fix this @antonmedv
Open new issue
Most helpful comment
I have the same issue.
and I find out
echo $0will output '-bash'.yes, with leading "-".
using native ssh and deployer 4.2.1
but phpseclib is okay.