[Klug-general] PSCP from Windows to Linux via PHP

Nathan Friend nathan.friend at gmail.com
Thu May 5 16:10:14 UTC 2011


Afternoon KLUG,
I'm using a PHP script to copy a file from a Windows machine to a Linux machine.

I found PSCP, a windows version of SCP
(http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
which works perfectly from the Windows CLI.

Unfortunately when I run it from a PHP script it just hangs at the
PSCP commend.  No errors in the Apache log, so I guess it's waiting
for something.

<?php
exec('c:\apps\pscp -q -i c:\key\akeyfile.ppk c:\source_file.txt
user at linuxbox:/destination/');
?>

I'm using key files to prevent a password prompt and the -q switch to
suppress output.

Any ideas?

Cheers,

Nathan.



More information about the Kent mailing list