Page 1 of 1

Remote Connection/Access

Posted: Sat Apr 02, 2011 4:58 pm
by colby.anderson
I'm new to PHP. Does anyone know how to connect to a port other than SSH2? For example, port 9999 instead of port 22.

Re: Remote Connection/Access

Posted: Sat Apr 02, 2011 6:06 pm
by fugix
maybe try the ftp_connect() funtion...first parameter is the host, second is the port, and third is the timeout...the last two parameters are optional so you would have ftp_connect(host,port);

Re: Remote Connection/Access

Posted: Sat Apr 02, 2011 6:19 pm
by colby.anderson
Is the ftp_connect() function an API?

Re: Remote Connection/Access

Posted: Sat Apr 02, 2011 6:27 pm
by califdon
It's one of many built-in functions of PHP. See http://php.net/manual/en/book.ftp.php. But I think you may not want to be restricted to the FTP protocol, so you may find PHP's socket functions to be what you need. See http://us3.php.net/manual/en/function.s ... onnect.php. This is not an area in which I have any experience, so I can't help you more than this, but I think it may point you in the right direction and maybe others can help you more.