Skip to content

Instantly share code, notes, and snippets.

@jhgaylor
Created July 5, 2012 12:38
Show Gist options
  • Select an option

  • Save jhgaylor/3053460 to your computer and use it in GitHub Desktop.

Select an option

Save jhgaylor/3053460 to your computer and use it in GitHub Desktop.
<?PHP
#phpinfo();
$path = "/var/www/vhosts/jgaylor.net/httpdocs/mapsV3/input.py";
if(file_exists($path)){
//echo "File exists.<br>";
} else {
echo "File does not exist.<br>";
}
/*
exec("dir", $output, $return);
echo "Dir returned $return, and output:\n";
var_dump($output);
*/
shell_exec('sudo python '.$path);
shell_exec('python '.$path);
exec('sudo python '.$path, $o1, $r1);
exec('python '.$path, $o2, $r2);
passthru('sudo python input.py');
passthru('python input.py');
var_dump($o1);
var_dump($r1);
var_dump($o2);
var_dump($r2);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment