-1

I created a temporary file using fopen in php and get the file owner/user id and username. My question is

Is it always httpd a username for php generated file? Is it always for apache? Can we change the username for apache?

skaffman
  • 398,947
  • 96
  • 818
  • 769
Xelakz
  • 175
  • 3
  • 11

1 Answers1

3

You can view/change the user that Apache runs as with the User directive. (Directives are found in the httpd.conf file, usually in /etc/apache2, on a Mac.) If you want PHP and Apache to run as different users, then you can use the Suexec module to switch to a different user when running PHP scripts.

See this question for a discussion of the pros and cons of Suexec vs MPM-ITK.

Community
  • 1
  • 1
Chris Middleton
  • 5,654
  • 5
  • 31
  • 68