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.