This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Run shell commands over ssh or locally from PHP.

v0.0.1 2021-09-17 02:27 UTC

This package is auto-updated.

Last update: 2021-10-17 02:45:47 UTC


Run shell commands locally or via SSH. Primarily for simplifying running commands on remote machines, either interactively or capturing the output.


Install via composer. Example usage:

use TJM\ShellRunner\ShellRunner;

$shell = new ShellRunner();

//--run `ls` locally, capturing output
$output = $shell->run(Array(
	'command'=> 'ls'

//--run `ls` remotely, capturing output
$output = $shell->run(Array(
	'command'=> 'ls'
	,'host'=> ''

//--SSH into remote machine interactively.  Will not capture output.  Interaction will require running PHP on command line, not in browser.
	'host'=> ''
	,'interactive'=> true

Other Options