Posted By

jdstraughan on 07/09/08


Tagged

php Shell linux commend shellexec


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jdstraughan
jamesming


Linux shell commands from php script


 / Published in: PHP
 

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

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.

  1. $output=shell_exec('command 2>&1');

Report this snippet  

You need to login to post a comment.