Saturday, May 5, 2012

How can I tell which user Apache is running as using PHP?

Create a file in your root web directory named whoami.php with the following code inside:
echo shell_exec('whoami');
Then, access whoami.php using your browser at an address such as:

The name of the user Apache is running as will be displayed in your browser.

When you're finished testing, delete whoami.php.

No comments:

Post a Comment