3

I want to write a little PHP script using the ssh2_* functions to deploy some code to several servers concurrently and run a few tasks.

Is this possible in PHP, or do I have to wait for each request to complete?

I can use a different language, but we're a PHP shop so I thought I'd stick with the familiar.

mpen
  • 272,448
  • 266
  • 850
  • 1,236
  • 1
    See this question: http://stackoverflow.com/questions/24500704/ssh2-exec-wait-end-of-a-process-to-run-next/24500766?noredirect=1#comment37930064_24500766 He **wants** it to wait for the first command to finish before running the second, but it doesn't. I think that should answer your question. – Barmar Jul 01 '14 at 00:46
  • I think you need this http://stackoverflow.com/questions/858883/run-php-task-asynchronously – Hong Truong Jul 01 '14 at 00:53

1 Answers1

3

ssh2_exec() allows multiple concurrent requests. See here.

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • Aha! Maybe I'm creating problems where there isn't one then. I'll try this and see how it goes. Thanks! – mpen Jul 01 '14 at 00:57