Re: passthru() passing variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, June 17, 2005 6:47 am, Jason Barnett said:
> What is a reliable cross-platform way of showing which user PHP is
> running as?

http://php.net/get_current_user

The bogus User Contributed note about REMOTE_USER is, well, bogus, almost
for sure.

If that fails, I guess you could try:

<?php
  ob_start();
  phpinfo();
  $phpinfo = ob_endclean();
?>

Then you have to dig out the PHP User from that.

It's possible there is a PHP Constant here that is the User:
http://php.net/manual/en/language.constants.predefined.php

If none of those work, I'm guessing even Windoze has something like
"whoami" so you could http://php.net/exec "whoami" or its equivalent,
based on the http://php.net/php_sapi_name

If all that fails, I'd just give up. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux