writting to file in php
Hi, I've been working on this on website for a bit, but theres a problem when I attempt to open a file to append info on it(in PHP). Here's the pseudo code, where i believe the problem is:
Code:
if (!($logging = fopen('./cgi-bin/current.txt', 'a'))) Code:
if (!($current = fopen('./cgi-bin/users.txt', 'r'))) -- Ayron |
Assuming you run PHP as an apache-module, it will try to open the file as the system-user as used by apache (e.g. user "www" or "www-data", depending on your distribution). This system-user probably does not have write access to the file.
You can find out which system-user apache uses as by creating a file "whoami.php", and access it with a browser. Then make sure the system-user displayed has write-access to your file. PHP Code:
|
Thanks, I had completely forgotten about file permissions.
|
All times are GMT -5. The time now is 03:21 AM. |