views:

24

answers:

1

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 or chmod 750
luckytaxi
`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
I think you meant `www-data` rather than `www-date`
UltimateBrent
double doh ... yea i meant read/write w/ no execute. www-date if he's using debian.
luckytaxi
How do I do this - change ownership to the apache user (either apache, www-date or http, depending on OS).
Mark
You'll need access to the console either via ssh or directly logged in. Do you have such access?
luckytaxi
umm, so ssh is shell (command prompt), what do I use? `chown file.txt "apache"` or something like that
Mark
yes, you'll need to figure out which user owns the apache process.
luckytaxi