Reputation: 39
I have some txt files with informations, but this *.txt files is going to be readable and writable by server php, (for example include them or just check them).
but i dont what this files to be accesstable from browser for example the user must can not view the files with http:// mysite/myfile.txt
what perrmission i have to set up for this files when php makes them?
Upvotes: 0
Views: 496
Reputation: 9765
You can't do that using permissions. In both cases server will read file.
You have to put this file in public parent directory (eg. in directory where is your public_html
). This way you'll be still able to include it but noone can read it using browser.
Second option is to set correct .htaccess
file to deny all users (it'll still allow you to read it from scripts), eg. like this:
order deny,allow
deny from all
Upvotes: 1