Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 have something like this:

$re = shell_exec("sudo /usr/local/share/phantomjs --version");

Unfortunately this gives me another problem:

 sudo: no tty present and no askpass program specified
 Sorry, try again.

User that cron runs under is bokac so Using visudo as root I added line in /etc/sudoers :

  bokac ALL = NOPASSWD: /usr/local/share/phantomjs

I have to mention that /usr/local/share/phantomjs is a sym link to executable under /usr/local/share/phantomjs-master/bin/phantomjs.

Basically, this is not working, I keep getting error message stated above. Is my sudoers line correct? What am I doing or not doing wrong? Any help appreciated.

share|improve this question
up vote 0 down vote accepted

All this was solved by chmod 0777 on executable file that sym link was pointing at, and no need for changing sudoers any more. That made more confusion then help.

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.