Apache 2.2.3, PHP 5.2.17, RHEL 5 64bit
If I do a
echo shell_exec('echo $HOME'); in a page on my server and I view it in my browser I get :
/root, which is not what I thought I should have (
whoami command returns apache
Same result with
Any idea ?
Apache starts as root and then changes to the Apache user but that doesn't update the environment variables. See here: http://serverfault.com/questions/179833/apache2-user-home-directory-lock-to-root
If you want the document root of Apache you should use
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki