How do I find out, which user is running the current php script?

apache, php

Solution

Execute `whoami`:

<?php echo exec('whoami'); ?>

Problem

How do we determine which user the php script is running under when I run the script on server? Is it running under the same user as apache or phpmyadmin by chance? My question maybe wrongly framed but I want to know which user so that I set appropriate permission for different folders in /var

Original source

Related problems