linux - PHP execute shell command and return full output -
i'm having trouble getting full output shell command returned php script.
if run command in terminal:
cd /home/moodledata; sh gam-create.sh "12345" "test" "mc person"
then following output in terminal:
creating account 654321@ourdomain.ac.uk error 409: entity exists. - duplicate
however, if run through php script:
<?php $u = "test"; $s = "mc person"; $u = "654321"; exec("cd /home/moodledata; sh gam-create.sh \"$u\" \"$f\" \"$s\"", $retval); var_dump($retval);
i following returned output:
array(1){ [0] => string(49) "creating account 654321@ourdomain.ac.uk" }
i don't error message.
i've played around using different functions, such shell_exec() passthru() , system() can't see full output returned php script.
could advise i'm going wrong?
cheers.
sorry, nevermind, worked out now. needed append 2>&1
command
Comments
Post a Comment