Reputation: 5413
I have config.php, I did a ls-l on that file which shows -rwxrwxr-x read, write and executable.
but on the PHP script, is_writable(config.php)function shows the file is not writable.
why is that?
Upvotes: 0
Views: 3185
Reputation: 6825
which group does the file belong to?
the rwxrwxr-x says, that the file is writable by the user and the group, but not by others.
now if your webserver process (that hosts php), is accessing the file, it is doing so as user 'nobody' or 'www-data', so THAT is the user that needs to own the file or have group-write-access to it.
a quick fix: if you do a chown of the file to the user under which apache is running, you should be fine.
Upvotes: 0
Reputation: 523
Probably because the php script runs as a different user than you running ls -l
Try executing: chmod +w config.php
Upvotes: 1