title: How to sudo from exec function using nginx, php-fpm, and Arch Linux
body: <p>I can log in as any user and <code>sudo whoami</code> without password and get "root". When i try this with <code>php -r 'echo exec("sudo whoami");'</code> it works regardless of what user i am. But when i run this through the webserver (nginx) i get nothing. What gives?</p>
  
  <p><code>ps xau | grep php</code></p>
  
  <p><code>root       207  0.0  2.6  19876  4992 ?        Ss   23:16   0:00 php-fpm: master process (/etc/php/php-fpm.conf)
  http       228  0.0  1.6  19876  3152 ?        S    23:16   0:00 php-fpm: pool www
  http       229  0.0  1.6  19876  3144 ?        S    23:16   0:00 php-fpm: pool www
  root       326  0.0  0.3   2504   692 pts/0    S+   23:59   0:00 grep php</code></p>