to get the username of the process owner (rather than the file owner), you can use:
<?php
$processUser = posix_getpwuid(posix_geteuid());
print $processUser['name'];
?>
![]() | get_current_userDescriptionstring get_current_user ( void )Returns the name of the owner of the current PHP script. See also getmyuid(), getmygid(), getmypid(), getmyinode(), and getlastmod(). ![]()
justin samuel
09-Oct-2005 02:45
to get the username of the process owner (rather than the file owner), you can use:
justin samuel
09-Oct-2005 02:25
with 4.3.11 (and i assume all other versions):
joho at pop3 dot nu
06-Oct-2005 08:43
get_current_user () returns the owner of the process running the script. In most cases, this will be the web server user ("nobody", "httpd", "apache", etc).
SiliconExpress at Techie dot com
20-Jun-2005 10:34
The 'constant' __FILE__ works easier ...
comicforum at lelon dot net
23-Apr-2005 05:51
Under windows, this function does not work the same in Apache as it does in IIS. If you want the user name in apache, you have to use...
chris
05-Jan-2005 11:36
If you want to get the absolute name of the file you are currently on, use this: | ![]() |