-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SFTP - Error when sending file #42
Comments
Does the file get transferred? |
Hello ! Thank you for your answer. Have you maybe another idea ? :-) |
It would help to know if SCP works at all beforehand. Could you try to transfer the file using |
Yes I can transfer file with SCP command. |
@anthonyherve Whats your PHP Version? I can confirm this bug, using this version of PHP:
|
Here is my version :
|
I reran the last travis builds, and the functional tests there worked: https://travis-ci.org/Herzult/php-ssh/builds/49846322 Event against our PHP Versions 5.5.21 and 5.6.5. I honestly dont know whats wrong here 😩 |
Probably related bug - https://bugs.php.net/bug.php?id=64169. |
Same bug. PHP 5.5.9 : https://i.imgur.com/k6HPsvU.jpg |
Same on PHP 7.0.19 (cli) (built: May 13 2017 00:54:47) ( NTS ) @h4cc @Herzult it is connected with https://bugs.php.net/bug.php?id=73597 Solution (intval):
|
Thanks for that fix @marcint1990, that worked for me. I found I was also getting the remote fully-qualified path wrong. A bare filename would not work for me, I had to add Is someone raising a patch/PR for this? |
I'm not sure why @Herzult abandoned the repo, but fixed version can be found among forks (for example, https://github.com/GinoPane/php-ssh v1.1.2) |
Hello,
I have a problem when I want to send a file through SFTP. This is the following.
[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: file_put_contents(): Unable to open ssh2.sftp://Resource id #568/${path_remote} on remote host
Here is my code :
$configuration = new Configuration('url');
$authentication = new Password('username', 'password');
$session = new Session($configuration, $authentication);
$sftp = $session->getSftp();
$sftp->send("local_file", "remote_file");
Error is on the last line.
Can you help me please ?
Thanks.
Anthony
The text was updated successfully, but these errors were encountered: