I'm trying to use the ftp_connect in PHP, but would like to change the port. Here's what I have ftp_connect('www.blockfilter.info', 22); However, it doesn't work. I can connect without the port number, and I know I have sftp access. I think my formatting may be wrong. Thanks EDIT: Let me clarify, I would like to connect via SFTP in PHP, how exactly do I do this?
The server you are attempting to connect with must be configured to accept ftp connections on the port (22) you wish to use before you can connect to it. Typically FTP access is set up for port 21
Hi, <?php // configuration $host = "www.blockfilter.info"; $port = 21; // connect or die. ftp_connect($host, $port) or die("Could not connect to $host"); ?> Code (markup): If you would like something a little more advance, send me a PM. edit: i see you resolved it, hadn't refreshed.