I am trying to make a php script on a webserver write into a folder /data on a fileserver.
Apache 2.2, PhP 5.x. It's just a test configuration but I'd like to understand the thing somehow as I am not very experienced regarding permissions when it comes to webservers.
I am sharing the folder /data on the fileserver by adding
/data 192.168.20.6(rw,sync,no_subtree_check) Mount the folder by
sudo mount 192.168.20.5:/data /mnt/data Create a link to the webroot(does that makes sense at all?)
sudo ln -s /mnt/data /webroot/site1/share Then I get this:
Warning: fopen(/webroot/site1/share/data/uploads/Fotoraum/Original/Bluehend/test.txt): failed to open stream: Permission denied Where and how do I have to adjust permissions in a sane manner to allow the script to write into /data and its subfolders?
Thanks a lot!
www. You mounted usingsudo, hence the mountpoint is owned byroot. Please post the output ofls -ld /mnt/dataandsu <www-user>; touch /webroot/site1/share/foo.txtdatafolder.