0

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.

David Refoua
  • 3,476
  • 3
  • 31
  • 55

0 Answers0