I understand that calling PHP functions like exec
and system
would run the process with the same user as PHP itself, or the web server running it.
Is there any way to run executables with PHP as a different user?
Please note that I'm looking for a built-in PHP functionality, I'm well aware of the sudo
alternatives.
EDIT:
I ended up using the setid
flag on the binary to run the executable as root.