I'm running a PHP script from CLI interface.
How can I get the running user name like when I'm in Apache ( $_ENV['APACHE_RUN_USER'] )?
At now I'm using exec('whoami'), but is not platform-indipendent.
Thanks.
I had success with $_SERVER['LOGNAME']
You could use $_ENV['USERNAME'] and it may be portable at least between Win and Linux
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With