Skip to content

Instantly share code, notes, and snippets.

@davidvanvickle
Created December 6, 2011 01:18
Show Gist options
  • Save davidvanvickle/1436235 to your computer and use it in GitHub Desktop.
Save davidvanvickle/1436235 to your computer and use it in GitHub Desktop.
run shell script from php cgi
function syscall($command){
$result = '';
if ($proc = popen("($command)2>&1","r")){
while (!feof($proc)) $result .= fgets($proc, 1000);
pclose($proc);
//return nl2br($result);
return $result;
}
return '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment