Page 1 of 1
php script to do ftp over ssh
Posted: Tue Feb 21, 2006 7:53 pm
by amyarjun
hi there,
have anybody have done any script to do ftp over ssh.
if yes i hope can quide me up on how to do it.
tq.
ftp_ssl_connect
Posted: Tue Feb 21, 2006 11:18 pm
by dickey
Try the PHP function ftp_ssl_connect and then the usual PHP ftp functions.
See
http://au.php.net/manual/en/function.ft ... onnect.php for detail on using ftp_ssl_connect, and troubleshooting issues:
In particular, that OpenSSL support is enabled in PHP, and that you may need to compile a separate binary if using Windows.
Example use: extracted from the above link:
Code: Select all
<?php
// set up basic ssl connection
$conn_id = ftp_ssl_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
echo ftp_pwd($conn_id); // /
// close the ssl connection
ftp_close($conn_id);
?>
I trust this will assist you.