Linux shell commands from php script

/ Published in: PHP
Save to your folder(s)

The “2>&1″ bit tells to pipe the standard error to the standard output. Otherwise the standard error may not be outputted by the system and you won’t have a way to troubleshoot your script.

Copy this code and paste it in your HTML
  1. $output=shell_exec('command 2>&1');


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.