Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I'm using PHP script from cli, the script calls exec() few times. There are some minor errors sometimes, which are handled by php script. I'm suppressing the errors by appending 2>/dev/null to the end of each command... Is there any way to achieve that without adding the forementioned?

share|improve this question

1 Answer 1

If you use proc_open instead of exec, you should get more control over the file descriptors.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.