1

I'm running the following exec method in php.

exec("exec /bin/bash ./test.sh $file $fileY 2>&1", $output, $return);

However when I print out the $return variable I get 1 as a result which is an error code.

How do I diagnose this to find out why this error code is appearing, I've tried a number of different methods to figure it out like setting permissions for everything to 077 but none of it is working.

Can anyone advise me on what to do?

4
  • What is the result of /bin/bash ./test.sh $file $fileY 2>&1 && echo $?? Commented Jun 29, 2016 at 13:58
  • Do you mean adding && echo $? to the end of the first parameter of the exec method? Commented Jun 29, 2016 at 14:01
  • No ! executing it in the terminal is what I meant Commented Jun 29, 2016 at 14:03
  • This is an [ intersting read ] for this one as you're passing arguents. Commented Jun 29, 2016 at 14:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.