Connecting Tech Pros Worldwide Help | Site Map

ssh2 using Windows

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 02:15 PM
adamsbarker
Guest
 
Posts: n/a
Default 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.


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.