php script to do ftp over ssh

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amyarjun
Forum Newbie
Posts: 2
Joined: Fri Feb 03, 2006 3:14 am
Location: PJ Malaysia
Contact:

php script to do ftp over ssh

Post 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.
dickey
Forum Commoner
Posts: 50
Joined: Thu May 16, 2002 8:04 pm
Location: Sydney, Australia

ftp_ssl_connect

Post 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.
Post Reply