Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

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

share|improve this answer
add comment

Your Answer

 
discard

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.