|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #77511 Support for socket stream
Submitted: 2019-01-23 23:29 UTC Modified: -
From: ininflamable at gmail dot com Assigned:
Status: Open Package: MySQLi related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ininflamable at gmail dot com
New email:
PHP Version: OS:


 [2019-01-23 23:29 UTC] ininflamable at gmail dot com
To connect to MySQL through an ssh tunnel, we now have to have a process that opens that tunnel and then close that process when it is not necessary.

It would be much simpler if you could open a socket stream and when opening the connection with MySQL, specify that you do it through that socket stream.

Test script:
$scp = ssh2_connect($host, 22)
ssh2_auth_pubkey_file($scp, $user, $pub_key, $pem_key, $key_pwd);
$tunnel = ssh2_tunnel($scp, 'localhost', 3306);
$db = new mysqli(null, 'root', null, null, null, $tunnel);


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 27 23:03:36 2021 UTC