Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need apache to be able to run sphinx index tool as I am building a web based interface to reindex and check various sphinx configs.

Currently I have added the following to visudo

Defaults:%apache !requiretty
Defaults:apache !requiretty
apache ALL=(sphinx) NOPASSWD: /usr/bin/indexer, /usr/bin/indexer

The command I am running is:

exec sudo -u sphinx indextool --checkconfig --config /path/to/sphinx.conf

This is being run with PHP's proc_open

    'stdin' => array('pipe', 'r'),
    'stdout' => array('pipe', 'w'),
    'stderr' => array('pipe', 'w'),


sudo: no tty present and no askpass program specified
share|improve this question
up vote 2 down vote accepted

Turns out that I need to use the full path for the command

 exec sudo -u sphinx /usr/bin/indextool --checkconfig --config /path/to/sphinx.conf

Now everything works great

share|improve this answer

Your Answer


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.