Re: Failed to write to a text file (text file is RW) [message #171478 is a reply to message #171475] |
Wed, 05 January 2011 08:47 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 05/01/11 03:19, justaguy wrote:
> "
> It should NOT be world writable,
> "
> world writable means to let Internet users to write to it, so, the
> global w attribute is removed, how could an anonymous user
> write to it?
No. The file system access attributes control access for the server file
system. Internet users are not logged on to the server as users. The web
server process is the user that is accessing the file.
eg If your web server process runs as user www_data then www_data will
be the owner of any file it creates, and will only need owner rw access
to read and write the file.
> "
> You can single thread access on some OS's - see flock() in the PHP
> documentation.
> "
> sample code? Since I'm not a php coder and don't intend to become
> one, at least not now... could you save me some time?
There's usually plenty of code examples in the user added notes to the
php manual. Go read.
> "
> But better is to use a database, which will solve all these problems.
> "
> No, not practical, this is a temp task (a poll).
The database functionality may already be there, simply waiting for you
to take advantage of it.
Rgds
Denis McMahon
|
|
|