I am using LAMPP to run apache server. From a php file I am executing a python script which executes ssh, scp commands. But I am getting error:

sudo: no tty present and no askpass program specified

I looked for this error and as per suggestions I created wheel group in sudoers file as:

%wheel  ALL=(ALL)       NOPASSWD:ALL

In the httpd.conf file I have user=apache and I changed


But still I am getting above error, not sure why. When I do exec(whoami) in php file it prints daemon so not sure with which user my php is getting executed.

  • 2
    Running any commands with root permission from web interface is not wise. You might as well install Apache as root. Dec 10, 2015 at 7:40

1 Answer 1


you have to disable requiring tty in your sudoers :

Defaults    !requiretty

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .