0

Possible Duplicate:
How To Execute SSH Commands Via PHP

I've searched here for some solutions but I couldn't find anything useful, so I'll just ask it.

OK, so what I want to do is a SSH Remote Connection FROM my website to the remote server machine. Both are Windows for now but I'll get some Linux servers soon so I will have to make it compatible with Linux systems. Well, back to topic. I'm currently trying to create a Game Server Control Panel in PHP which will start and stop .exe's over the internet on my Dedicated Servers, but I need to know how to do it in PHP.

I've currently not come up with anything at all because this is still an idea of mine. I know I should make it in ASP.NET but I have no knowledge in ASP.NET whatsoever.

I've installed Cygwin Server on my remote machine and it's working.

How do I make a PHP SSH Connection to my remote machine(s)?

EDIT: I have full root access to both machines.

Community
  • 1
  • 1
Sven
  • 5,155
  • 29
  • 53

1 Answers1

0

You should be able to use PHP's exec() function to execute a script to do what you need. See here: http://php.net/manual/en/function.exec.php

Micah Henning
  • 2,125
  • 1
  • 18
  • 26
  • 4
    Eugh. Dropping down the shell should be the last resort. There is at least one perfectly good SSH library available for PHP. – Quentin Oct 22 '12 at 16:36