PHP - changing ownership of a process while running
Question
I have a PHP script that I need to run as root from the command line.
After the script completes some critical operations (that require root access) I would like to change the owner of the process to 'nobody'.
Is that possible with PHP? How can I do it?
Solution
You can change user/group ids with the following functions:
If you need to change the group, you'll want to perform that first.
OTHER TIPS
No, script cannot change ownership explicitly to root.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow