ssh2_tunnel returns a socket stream (e.g, the output of fsockopen). You can use something basic like this to send a line break and get any output back to test that it's working:fwrite($tunnel, "\n");while (!feof($tunnel)) { echo fgets($tunnel, 128);}Just a reminder: you can't currently use the socket with any of the cURL functions.