Reputation: 17530
I got a folder in my server where i need to write data dynamically, and the data should be also visile to the viewers, though they will not be served directly.
I will add the data from those file by PHP and will server them,
What should be the permission for this folder ?
If i use anything other than 777 it shows an ERROR on my local machine [i'm root there]
Upvotes: 0
Views: 75
Reputation: 270609
The directory needs to be owned (or writable and readable) by the user under which Apache runs. The user is likely to be something like apache
or www-data
or httpd
. Find out the apache user and then set ownership:
chown -R apacheuser:apacheuser /path/to/your/directory
chmod 700 /path/to/your/directory
Upvotes: 2
Reputation: 2103
Please make sure your folder that you are giving permission have no credentials(password files) i.e pictures folder or publicly available files.
777 permission mean you are giving that folder full permissions including wright also. So in that case 777 is mandatory because dynamically upload files!
Upvotes: 0