Hello,

I have a audio test command
Code:
speaker-test -c 2 -t wav | sleep 5
and it works fine when i type this in the linux shell window.

BUT

when i want to run this command using php

PHP Code:
<?php
shell_exec
("sudo -u usman speaker-test -c 2 -t wav | sleep 5");
?>
It dont work and as i see the apache log i get this error message


sudo: no tty present and no askpass program specified
Then i Google and someone told to make the sudouser (in my case usman) a passwordless user.

What changes i have made in my /etc/sudoers files are

#Defaults requiretty
usman ALL=(ALL) NOPASSWD: ALL



I am really not sure how to get it working.

Kindly help.

Thank you

usmangt