vladn Posted July 31, 2009 Share Posted July 31, 2009 I've got a DB server on client side on a local computer with a local IP (192.168.1.12). My Web server is on a different network on a different IP, obviously I can't really connect to the DB server. The client gave me a VPN access to his DB server. So now I am wandering if I can create in PHP a VNP tunnel or something similar and get the data from the server through VPN connection. thanks. Quote Link to comment Share on other sites More sharing options...
vladn Posted August 3, 2009 Author Share Posted August 3, 2009 any ideas? Quote Link to comment Share on other sites More sharing options...
phpSensei Posted August 3, 2009 Share Posted August 3, 2009 configure your firewall so that you can access the database from the internet. ie 0.0.0.0:3306 would forward to your MySQL database. Othewise for PHP to access it the server that PHP is running on needs to do the VPN connection itself. What you can do is have PHP do a command call like exec() and launch the VPN connection. You will not need any special PHP code, PHP can access it just like if that database server was in the local network (That's in fact the definition of Virtual Private Network). You can have PHP close the VPN connection via command line (if you have a VPN client that works through command line). If it's not possible to create the VPN connection via command line, and therefore through PHP. You need to manually log on to the computer and initialize the VPN connection. This would not be bad if your PHP application is known to run at specific time or is run manually, such as a script. Let me know if any questions, Dan I found this through the internet, I don't know if it will solve your problem or not. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.