Every time I attempt to write to text files online, I get a permissions error. Because my host limits me to just 2 MYSQL DB's I use text files for learning first. Whenever I read from a text file it will usually do it no prob, but when I attempt to write to one, it refuses. examples here: http://www.nixopax.com/php/online.php
http://www.nixopax.com/flash/chronotrigger.php
All I need to do is provide a simple counter with php. Does anyone here know how?
Permissions error?
Moderator: General Moderators
It is very unlikely you need 777. The only thing you need to do is to find out who is executing your php script. That is usually the user that is running the apache program. Usually that user is called www-data or nobody. Then you have to find out if that user is part of the group that owns the file or not. Let's assume the user is not in the group, thus belongs to others.
First you want to allow that user to enter /home/user/web
chmod o+x /home/user/web
And you want to give rights to create files in /home/user/web
chmod o+w /home/user/web
If you want to give rights to read the list of files in /home/user/web
chmod o+r /home/user/web
You can find some more background info here:
http://www.freebsd.org/doc/en_US.ISO885 ... sions.html
offcourse there are a zillion other sites too
First you want to allow that user to enter /home/user/web
chmod o+x /home/user/web
And you want to give rights to create files in /home/user/web
chmod o+w /home/user/web
If you want to give rights to read the list of files in /home/user/web
chmod o+r /home/user/web
You can find some more background info here:
http://www.freebsd.org/doc/en_US.ISO885 ... sions.html
offcourse there are a zillion other sites too