Apart from the fact that this is not a PHP question, you could ask the user for the root pw, but a cleaner and probably safer option is to build a pause into the script and put all the root-requiring actions into a seperate script that can be run by the root (NOT by the user itself).
That way it's not possible for the user to abuse the root pw in any way, and you can't accidently do root things where it's not required.
No sane admin will ever enter the root password on a user's terminal just like that.