Welcome to the Treehouse Community
Looking to learn something new?
whoami in workspaces and chmod in php (also in workspaces)
When I type whoami in the workspaces console I get treehouse. However, if in index.php I echo either exec('whoami') or shell_exec('whoami') I get apache. Why is that? Also, I can't seem to figure out how to allow the use of the chmod function in index.php. It works fine in the console.
Seth Kroger56,407 Points
Apache, the web server is what is running you PHP file through a PHP interpreter. It's a common setup to have apache run as it's own user, also named apache, for security and other reasons. This means it won't be able to read anyone else's private files, or modify their files. chown won't work, of course, because you have to be the file's owner to use it.