2

I am currently using PHP exec to make use of Psexec to execute commands on a remote machine in my LAN. It sort of works, but I run into trouble every so often and have to google around for an answer, which causes me to make changes.

I will soon have to be executing commands on a remote linux machine as well from windows and I was wondering should I just quit Psexec alltogether and make use of SSH commands from PHP. I haven't used the SSH2 extension before and from the docs it looks like I am going to have problems too due to the fact I am using a windows machine.

But rather than mainting Psexec and PHP SSH - should try getting PHP SSH2 to work on a windows machine and on the remote windows machine isntall a SSH server.

Or is there an alternative that I need to consider?

Abs
  • 56,052
  • 101
  • 275
  • 409

1 Answers1

1

I would recommend using phpseclib, a pure PHP SSH implementation. It's faster than PHP SSH2 to boot.

  • I have gone with the PsExec option for windows and SSH for running commands from windows on a mac/linux box. I'll be making use the suggested library, it works well. Thanks. – Abs Jun 24 '11 at 11:06