safest chmod for a file
What is the safest chmod for a web app to write into a simple .txt file, and 开发者_运维问答it should not be accessible by the public.
Thanks, Jean
Do you mean not accessible to the public via a web server? You would need to use a .htaccess
file to limit access.
PHP will most likely be hosted through the apache process or as a CGI probably running under the same user as the apache process, so chmod
wouldn't work in 90% of cases.
If your PHP process runs as another user, you can only allow r/w for the public. But if you mean not accessible by the public through your web server, you can use .htaccess do deny access to it.
精彩评论