Automatically start named pipe reader on startup?

view story

http://unix.stackexchange.com – I'm trying to run a script with root access from PHP. I can't do that because Apaches user, www-data, don't have root access because of security reasons. To fix that, i was advised to use a named pipe. I first tried to add sudo permission to www-data, but was told that was definitely not good due to security risks (plus, i tried to add it but it didn't work). This is where my problem is. If i understand this correctly, i will need a script that automatically starts on system boot, and constantly lays in the background trying to read from a named pipe. The script, a.k.a. pipe reader, has to be (HowTos)