Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMegan Weber
28,554 Pointswhoami 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.
1 Answer
Seth Kroger
56,413 PointsApache, 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.