Re: which user is a script executing as?
| From: | Peter Risdon | Date: | Sat, 24 Jul 2004 10:23:04 +0000 |
| Subject: | Re: which user is a script executing as? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191732@lists.php.net to get a copy of this message | ||
Matt M. wrote:
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.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