Hi. I have a noobish UNIX question.
I have a password-protected section of my website for testing (named 'sandbox') and I'm trying to write output to a plain text file in that directory. But I'm getting the following error due to permissions settings.
Warning: file_put_contents(testdb.txt) [function.file-put-contents]: failed to open stream: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/sandbox/dbtest1.php on line 5
I'm sure it's something simple, but what could I be overlooking?
It is likely that the attributes on the directory in question don't allow this. You need to enable the read, write, and execute permissions accordingly, assuming that the directory is not owned by the writing process(es).
While that may not have chnaged things recursively, your original claim of an isolated location is now invalid. That directory is open to all for reading/writing/executing. I'm not sure that matters in your case but you should be aware.
What L7Sqr said. The attributes you set on the directory means that anyone can, read, write, and access, files there. That may or may not be what you really wanted to do. It doesn't mean that they can modify files that already exist there, though that may be the situation depending upon the user id of the web server process.