This question already has an answer here:

I am using shell_exec in php to get content file and when I type sudo cat file this error is showing

unable to resolve ${host} 

I can solve this problem, but I want to disable all errors and warnings for user www-data

marked as duplicate by muru, karel, Fabby, Charles Green, pa4080 Oct 9 '17 at 9:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • How about redirecting the error output to /dev/null e.g. add 2> /dev/null to the command. – Robert Longson Oct 8 '17 at 8:19
  • i tring this and get same result @RobertLongson – Mido Bona Oct 8 '17 at 8:28
  • can you edit the question to include the shell_exec command argument(s) – Robert Longson Oct 8 '17 at 9:06
  • 1
    ... and do a sudo "sh cat file 2>/dev/null" instead of sudo cat file – Fabby Oct 8 '17 at 21:31

Browse other questions tagged or ask your own question.