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');

URL: http://www.z01d.com/2008/07/08/how-to-call-linux-shell-commands-from-php-script/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.