Forum Moderators: coopster

Message Too Old, No Replies

PHP SSH MySQL question

         

andrewsmd

6:11 pm on Oct 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So I use PHP and a MySQL server at my school for a website. Now when I copy files locally then I use the server localhost for the server name. My question is what if I want to access it remotely. What I mean is I have a PHP server in my house and I am tired of copying everything over every time I make a change to get it to work. I don't really know how to implement this at all. I can tell you that I run a windows environment but he PHP server is linux. I can use putty to ssh in and access mysql via my home computer so is there a way I could basically do the same thing with PHP? I use the DB.php class that requires PEAR. Any help would be wonderful! Thanks,

eelixduppy

6:19 pm on Oct 28, 2008 (gmt 0)



You can use a Unix text editor such as vi, vim, pico, etc... to edit your PHP files directly on the server. Is this what you are talking about?

andrewsmd

6:58 pm on Oct 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, I know how to do that. What I mean is excuting PHP locally on my machine through a PHP server but accessing a MySQL database on another server. The putty thing is how I execute MySQL queries right now, I was wondering if there is a way to do all of that with PHP so I can execute the code locally but set up an SSH tunnel and then MySQL through that.

eelixduppy

8:00 pm on Oct 28, 2008 (gmt 0)



You can connect remotely to MySQL if your settings allow. Instead of 'localhost' when you connect to MySQL, you should be using the location of the database server.