I just made a simple program to create files; I'm trying to get the hang of basic file manipulations.
Whatever file my program makes, the owner of the file is "www-data," so I can't edit it using my regular server user. I can use root to change the ownership to the server user, but I don't want to do that for every file.
That's why I tried to use chown() to give ownership to the server as soon as the file is made, but I get this error:
"Warning: chown() [function.chown]: Operation not permitted in /home/server/mysite/make.php on line 17"
chown(), chmod(), and chgrp() all apparently need root permissions.
So how do I give PHP the permissions required to use these functions??