Hey there. I got it working. It requires punching a hole in the sudo'ers file, but I'm willing to take that risk - there aren't a lot of people hacking away at my personal webserver, ya know?
Anyway, Add this to /etc/sudoers:
www ALL = NOPASSWD: ALL
Note that it lets your webserver...