2009年3月17日 星期二

Create/write file in PHP web page - the privileges

In typical operation, Apache is started by the root user, and it switches to the user defined by the User directive to serve hits. (-- Apache doc )

To allow PHP web page to create or write file, "chown" current directory to the user apache is using. ("chmod 777" might be a bad idea.)