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

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

1 Answer 1

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.