lilzz
lilzz

Reputation: 5413

PHP file is not writable error.

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

Answers (2)

mindandmedia
mindandmedia

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

Roman
Roman

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

Related Questions