You are here: PHP SSH and mysql connection « PHP Programming Language « IT news, forums, messages
PHP SSH and mysql connection

Posted by Hendrik Maeder on 06/29/05 12:14

For a long time I've been trying to connect to mysql through a SSH tunnel. Although that si possible by setting up the tunnel manually (with 'ssh -L ...'), I'd like it to be done by PHP itself.

Now, with the SSH2 extension (http://www.php.net/manual/en/ref.ssh2.php) it is possible to issue a 'ssh2_connect' and then a 'ssh2_tunnel' command.
That returns a socket resource to the destination server.
So far, all fine.

Problem:
How can I force that socket onto 'mysql_connect'?
I mean, what I have is:
$tunnel = ssh2_tunnel($connection, '10.0.0.101', 12345);

But $tunnel is a PHP resource, and not in the format ':/path/to/socket' that mysql_connect expects...

Is this possible at all?

Cheers,
Hendrik

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация