Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to figure out which user it is that executes a php-script in a webserver using php-commands? (I don't have shell access to the server running httpd, so I cant use ps.)

share|improve this question
up vote 3 down vote accepted

Use the function posix_getuid.

share|improve this answer
Thanks. That was the key-idea. In the end I used print_r(posix_getpwuid(posix_getuid())); – aioobe May 19 '10 at 10:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.