|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
10 + 49 = ?
Subscribe to this entry?

 [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-2022 The PHP Group
All rights reserved.
Last updated: Sun Nov 27 12:05:54 2022 UTC