I’m having a tough time finding the difference between the PHP functions posix_getuid and posix_geteuid. I know that posix_geteuid returns the effective user ID of the current process, but what does that mean? Also, whats the difference between setting the user id over setting the effective user id?
I’m having a tough time finding the difference between the PHP functions posix_getuid and
Share
They’re likely to always be the same for a PHP process. The only time they’re generally different is when a process is running as setuid, which is incredibly unsafe to do for PHP scripts (because the interpreter can be easily subverted by environment variables).
Note also that you can only change the uid/euid of the current process when one of the two is currently set to 0 (root).