Re: [PHP] which user is a script executing as?

2004-07-24 Thread Peter Risdon
Matt M. wrote:
How do I determine with which user's permissions PHP scripts are executing?
I am experimenting with suEXEC and running PHPs as CGIs; I need to know
with which user's permissions PHP scripts are executing.
I've tried using getmyuid() and get_current_user(), but these only report the
owner of the script - not necessarily whether the script is actually executing
as this user or not. I couldn't find this information in phpinfo().
Suggestions much appreciated!
Do you have User and Group (apache1.3) or UserGroup (apache2) lines in 
your httpd.conf or virtual host include file? These specify which user 
to run as under suexec.

Once that is in place, I generally just create a file from the script to 
see the uid.

Peter.
Thanks!

on linux
$user = `whoami`;
print $user;
you might need to get rid of  \n
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] which user is a script executing as?

2004-07-23 Thread Jack
How do I determine with which user's permissions PHP scripts are executing?

I am experimenting with suEXEC and running PHPs as CGIs; I need to know
with which user's permissions PHP scripts are executing.

I've tried using getmyuid() and get_current_user(), but these only report the
owner of the script - not necessarily whether the script is actually executing
as this user or not. I couldn't find this information in phpinfo().

Suggestions much appreciated!

Thanks!

Jack

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



Re: [PHP] which user is a script executing as?

2004-07-23 Thread Matthew Sims
 How do I determine with which user's permissions PHP scripts are
 executing?

Generally, if you execute a script through the web server, it's being
executed under the web server's UID.


 I am experimenting with suEXEC and running PHPs as CGIs; I need to know
 with which user's permissions PHP scripts are executing.


If you chown the PHP script to the web server's userid, that should be
good enough.


-- 
--Matthew Sims
--http://killermookie.org

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



Re: [PHP] which user is a script executing as?

2004-07-23 Thread Matt M.
 How do I determine with which user's permissions PHP scripts are executing?
 
 I am experimenting with suEXEC and running PHPs as CGIs; I need to know
 with which user's permissions PHP scripts are executing.
 
 I've tried using getmyuid() and get_current_user(), but these only report the
 owner of the script - not necessarily whether the script is actually executing
 as this user or not. I couldn't find this information in phpinfo().
 
 Suggestions much appreciated!
 
 Thanks!

on linux

$user = `whoami`;
print $user;

you might need to get rid of  \n

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