0

I have my websites folder on Mac where I have created a file sharing with user pi. I have then created a mount to this folder on Raspberry Pi like this in fstab

//my-mac.local/Projects /home/pi/projects cifs username=pi,password=raspberry

This creates a mounted folder projects showing all the directories and files on pi. I can also run my php site using Apache from this folder. But the problem is I can't write into that folder. If I run ls -l command then it shows root user with permission drwxr-xr-x.

How can I put permission to make it writable by Apache webserver?

  • Add uid=www-data,gid=www-data to the mount command options. – Dougie Feb 16 at 22:26
  • I tried that also but it gives permission denied message – codelearner Feb 17 at 6:55
  • Also if I try to run chown or chmod, nothing gets changed in permission. – codelearner Feb 17 at 6:56
  • What userid gets the "permission denied" message? Use their uid=xxx and gid=xxx values on the mount command. – Dougie Feb 17 at 9:51
  • using PHP I have tested to create one file in directory and I get fopen(newfile.txt): failed to open stream: Permission denied in /home/pi/projects/my-site/test.php – codelearner Feb 17 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.