I can log in as any user and sudo whoami
without password and get "root". When i try this with php -r 'echo exec("sudo whoami");'
it works regardless of what user i am. But when i run this through the webserver (nginx) i get nothing. What gives?
ps xau | grep php
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