I have created an SSH user on our system, fred, whose home directory is /home/fred and who has a subdirectory at /home/fred/someFolder. I am trying to allow PHP/Apache, which is running as nobody, to be able to create a file inside fred's someFolder directory. No matter what I try, I always get Warning: file_put_contents(/home/fred/someFolder/test.txt) [function.file-put-contents]: failed to open stream: Permission denied in /home/websiteDir/public_html/test.php on line 1
I have tried several different ways of doing this and nothing seems to work so far. Tried to chmod the folder to 777, 666, 660, etc. Tried chown with fred:nobody, nobody:fred, nobody:nobody, fred:fred, still nothing. Tried adding fred to nobody's group, tried adding nobody to fred's group, nada.
Sorry, I'm not all that great at linux... any advice would be appreciated.
ls -lhain /home/fred/someFolder and post it up here?total 8.0K drw-rw---- 2 nobody fred 4.0K Feb 14 11:15 ./ drwx--x--x 5 fred fred 4.0K Feb 14 11:15 ../