This question is in line with this question, I am trying to connect to secure FTP Server and it is not able to connect, wierd part is that I am able to do ssh and connect to the
Many cheap webhoster will not give you ssh (hence no ftp via ssh aka sftp) but only ssl-secured ftp aka ftps (see here). You might have that problem. As others suggested, use filezilla or another ftp client to test your credits and chosen security method beforehand.
ftp_ssl_connect() at least under windows will be a long journey, since you have to compile your own php binaries, see here.
As this php contributor rightfully points out, no secure connection is secure, as long as you don't know, who you are talking too, aka „peer certification“ through valid certificates.
phpseclib is probably your best bet. But I haven't figure out, how to ensure, it uses peer verification (guessing, the truth is in openssl.conf ...)
So even at the time of writing, I wonder more than ever, if peer-validated ftps (ftp with ssl/tls authentification) is possible... also see my question here.