Skip to content
Advertisement

Tag: shell-exec

sudo: no tty present and no askpass program specified When useing shell_exec

I have a php page that is trying to run a service restart using: $list=shell_exec(‘sudo /sbin/service NetworkManager restart’); I needed to edit my sudoers file to let this happen. Thus: #Defaults requiretty and apache ALL=(ALL) NOPASSWD: /sbin/service When that failed, as a test I ran: apache ALL=(ALL) NOPASSWD: ALL I have run a shell_exec without the sudo command: $list=shell_exec(‘whoami’); echo

Advertisement