|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55752 Allow mysqli to connect to existing socket connection
Submitted: 2011-09-21 08:49 UTC Modified: 2017-05-15 09:49 UTC
From: casper at bcx dot nl Assigned:
Status: Suspended Package: MySQLi related
PHP Version: 5.3.8 OS: Any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-09-21 08:49 UTC] casper at bcx dot nl
I would like a way to allow mysqli to connect to an existing socket connection.

My use case:

I have a connection to a remote server over ssh. Using ssh2_tunnel() I can 
a socket stream to the mysql server.

Currently the only way to do this is use the ssh binary to create a listening 
on my local machine and point mysqli to that port. 

I prefer using ssh2 over a direct connection to mysqli because of security 
reasons. This way I can keep mysql server to listen on localhost only. Also I 
would get the added bonus of key-based authentication.

As I already use ssh2 extensively for filesystem changes on the remote machine I 
already have the keys in place to do this.

From what I've understood the mysqlnd extension already uses PHP steams 
internally, so this shouldn't be impossible.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-28 15:35 UTC]
This is an interesting idea. As it is exotic I'm not sure we want it as a core feature and currently it is not trivial to do as plugin either. As PHP 5.4 is in beta and this feature requires some changes in the way the connection is created we can't do it for 5.4. 5.5 the soonest. Maybe we find a good way for a plugin before.
 [2017-05-15 09:49 UTC]
-Status: Open +Status: Suspended
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 06:01:30 2024 UTC