I want to be able to connect to a remote host (e.g FTP, SMTP, POP) through Socks5 using fsockopen
in PHP.
Please how do I go about it?
fsockopen
just opens a socket connection. You should manually create request packets and parse responses to implement Socks5
since there is no built-in support in PHP. See here to know how Socks5 works.
Alternatively you can use something like this SOCKS 5 class.