Wesley Wesley - 1 year ago 157
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download