How can I set permissions of a file to let a PHP program read and write but not be read by the public. When I set read permissions it denies PHP to the files.
A:
- change ownership to the apache user (either apache, www-date or http, depending on OS).
- modify permission,
chmod 700
orchmod 750
luckytaxi
2010-10-05 23:22:18
`600` / `640`, unless one is working with executable files... (sorry, pet peeve of mine that everyone seems to force all their files executable, makes admin tasks like _finding_ executables a hell...)
Wrikken
2010-10-05 23:50:28
I think you meant `www-data` rather than `www-date`
UltimateBrent
2010-10-06 00:34:15
double doh ... yea i meant read/write w/ no execute. www-date if he's using debian.
luckytaxi
2010-10-06 00:55:57
How do I do this - change ownership to the apache user (either apache, www-date or http, depending on OS).
Mark
2010-10-06 10:44:30
You'll need access to the console either via ssh or directly logged in. Do you have such access?
luckytaxi
2010-10-06 13:01:23
umm, so ssh is shell (command prompt), what do I use? `chown file.txt "apache"` or something like that
Mark
2010-10-06 23:12:03
yes, you'll need to figure out which user owns the apache process.
luckytaxi
2010-10-07 00:54:58