in reply to Executing Sudo Console via Web

I don't see where you use Sudo. If that is not your problem then I would suggest that you print out (getpwuid($<))[0] and see who Apache runs as, then go to the sudoers group to see whether that user has the permissions you want.