Hi,
I have a problem changing file ownership of files uploaded into a directory PHP creates... I need PHP to be able to delete files that have been uploaded.
If anyone has a suggestion I would greatly appreciated it.
What works -
I have been using an upload class to upload files into a directory. This all works great so long as I first create the directory set permissions from my Ensim control panel.
What doesn't -
When I create a directory via PHP mkdir and try to set the ownership whith chown I get errors.
The owner and group ID are set to 48 which I am pretty sure is Apache.
I think I need to set it to 505, but when I chown and chgrp the files from my php script I get
Warning: chown failed: Operation not permitted in /home/virtual/site3/fst/var/www/html/sabre_v2/test.php on line 6
Warning: chgrp failed: Operation not permitted in /home/virtual/site3/fst/var/www/html/sabre_v2/test.php on line 7
here is the code I am using.. where target is teh base address to the file.
chmod($target, 0777);
chown($target, 505);
chgrp($target, 505);
Is there some other step I am missing here?
C.