473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

ssh2 using Windows

i'm using Windows to access an ssh server. everything works perfect
until i try executing files (ssh2_exec) and sending/receiving files
(ssh2_scp_send/ssh2_scp_recv)... in the function manual at php.net it
has the following example to execute a command:

ssh2_exec($connection, '/usr/local/bin/php -i');

i'm assuming this is for linux/unix machines, so on a Windows machine,
should it be possible to do the following?

ssh2_exec($connection, 'c:/php/php.exe c:/a.php');

it doesn't seem to be working (the "a.php" file simply contains
"file_put_contents('c:/bbbbb.txt','111');" and therefore doesn't create
"bbbbb.txt"), however, the 'c:/php/php.exe c:/a.php' command works
perfectly using a ssh client such as PuTTY.

also, with the send/receive functions, it comes up with errors. for
example, "ssh2_scp_recv($connection, 'c:/a.php', 'c:/aa.php');" comes
up with the error "Unable to receive remote file". when creating a
directory i have noticed that i must be beginning in the directory:
"c:/documents and settings/administrator/desktop", because when using
"ssh2_sftp_mkdir($sftp, 'aaa');", it puts the directory "aaa" into that
location - ie, i have to use "ssh2_sftp_mkdir($sftp,
'../../../../aaa');" to create the "aaa" directory at c:/aaa

thanks,
adam.

Jul 17 '05 #1
0 2765

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: gonchi | last post by:
Hi, Something very strangne happens with the function ssh2_exec, i can't read the stream answer after execution in the remote computer. I work with apache 1.3.30 and php 4.3.10 , libssh 2.0.5 ....
7
by: brian.vincent | last post by:
I'm trying to use the ssh2 functions to run a graphical app. I have no problem opening ssh2_shell and running something like "/bin/ls /tmp". However when I try to do something like:...
0
by: grutta | last post by:
I am writing a windows service that will recieve notification when a USB Device is insterted into the machine. I have used the RegisterDeviceNotification and the RegisterServiceCtrlHandlerEx with...
0
by: Pewpew | last post by:
Hello, Is there an example of successfully use of the ssh2_auth_hostbased_file(), or ssh2_auth_pubkey_file() I tryed every thing with no success. Always have Authentication failed for...
3
by: Rob | last post by:
Hi all, I am having trouble converting the code below (found on http://vbnet.mvps.org/index.html?code/core/sendmessage.htm) into a format that will work using vb .NET. Can anyone have a look...
0
by: Bernhard Günther | last post by:
Hello friends of php, PhP-Version is 4 on a FreeBSD-System using apache. Got a problem using ssh2.sftp. Installed correctly (libssh2, ssh2.so-module). Connecting with publickey works,...
3
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and...
0
by: FishGills | last post by:
For the life of me I can not figure out why I am getting this error: Error starting up SSH connection(-5): Unable to exchange encryption keys $connect = ssh2_connect('d50-1.s50', 22); ...
2
by: roN | last post by:
Hi, I would like to send an ssh command to our ssh server from which i would liek to read the output. I get stuck with following lines: <?php $ip = 'server'; $user = '****';
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.