POSIX_SETUID(3) 1 POSIX_SETUID(3)
posix_setuid - Set the UID of the current process
SYNOPSIS
bool posix_setuid (int $uid)
DESCRIPTION
Set the real user ID of the current process. This is a privileged function that needs appropriate privileges (usually root) on the system
to be able to perform this function.
PARAMETERS
o $uid
- The user id.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
posix_setuid(3) example
This example will show the current user id and then set it to a different value.
<?php
echo posix_getuid()."
"; //10001
echo posix_geteuid()."
"; //10001
posix_setuid(10000);
echo posix_getuid()."
"; //10000
echo posix_geteuid()."
"; //10000
?>
SEE ALSO
posix_setgid(3), posix_seteuid(3), posix_getuid(3), posix_geteuid(3).
PHP Documentation Group POSIX_SETUID(3)