2

I have a php script that runs from apache2 call that needs to read files in a SD card. The SD card appears mounted in /media/user/name of SD card partition. I tried to read this answer Default file permissions for php user www-data but it did not help in my case. Can anyone help me? Thank you.

kaf
  • 123

1 Answers1

0

Giving the mount point of your SD card partition the correct ownership should do the trick. If you want the user who mounted the SD card to still have ownership permissions, you could change the group of /media/user/name/ and all of the files and folders it contains to www-data with:

chgrp -R www-data /media/user1/Núbia

Ensure that all of those files and folders have read and write permissions with:

chmod -R g+rw /media/user1/Núbia

It's worth getting to grips with permissions, to know whether you're introducing security vulnerabilities, but this should allow you to do what you need for now.

Arronical
  • 20,241