Home     Articles & Projects     Products & Web Services

How to find out what user PHP is running as

When configuring security and managing other aspects on your server it is often necessary to find out what user PHP is running as. In most installations, PHP is running as an Apache module, so it will be running as whatever user Apache is running as. Common examples are "apache" or "deamon". You can find out for sure by running the following script, which will display the output of the Linux "whoami" command:

<?php
  passthru
("whoami");
?>