0

I am trying to use shell_exec command in a php file.

shell_exec(date) works fine, but shell_exec(sudo date) is not working.

Is there any limitation with sudo command in shell_exec?

4
  • Check this: stackoverflow.com/questions/5652986/php-sudo-in-shell-exec Commented May 10, 2015 at 5:27
  • when using sudo in shell_exec, following msg is shown in the brwoser: 'sudo: no tty present and no askpass program specified' Commented May 10, 2015 at 5:41
  • Don't use sudo. Give proper permissions to resources so that the web server can execute the commands without sudo Commented May 10, 2015 at 5:57
  • TTY settings can be altered in sudoers. Commented May 10, 2015 at 6:51

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.