title: How to set timeout for a ssh command executed with php?
body: <p>I use php to execute scp commands via ssh via a wrapper function. The moves are between local and remote servers.</p>
  
  <p>I roughly know how long the script should execute for, and I would like to kill the scp process if its taking too long (due to a destination server getting bogged down, or other network issues). When this happens currently, the scp processes get locked up completely until the destination server is restarted or the scp processes are killed manually from command line. </p>
  
  <p>Can I pass some kind of timeout into shell_exec() that will quit the work its doing and proceed with the script execution? </p>