Wesley Wesley - 7 months ago 41
Apache Configuration Question

How to check what user php is running as?

I need to detect if php is running as nobody. How do I do this?

Are there any other names for "nobody"? "apache"? Any others?


If available you can probe the current user account with posix_geteuid and then get the user name with posix_getpwuid.

If you are running in safe mode however (which is often the case when exec is disabled), then it's unlikely that your PHP process is running under anything but the default www-data or apache account.