I\'m in the process of building an web app that will, besides other things, need to connect to a FTP server to download or upload files. The application is written in PHP an
The problem with Igor's recommendation is that it, among other things, makes for much less portable code (libssh2 isn't installed on very many hosts), it has a far more intuitive OOP-based API and RSA authentication actually makes sense (libssh2 requires you store the public key and the private key separately on the file system; the fact that they have to be separately provided is silly since most private key formats include the public key within them).
phpseclib is also faster:
http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/#comment_3759