I have set file permissions to 777 yet I cannot write to the file with PHP.
I can clearly see in my FTP client that the file has 0777 permissions and when I do:
echo (true === is_writable('file.txt')) ? 'yes' : 'no';
I get 'no';
I also tried:
echo (true === chmod('file.txt', 0777)) ? 'yes' : 'no';
With the same result.
The directory listing goes something like this:
public_html
public 0777
css 0755
js 0755
file.txt 0777
And I'm using .htaccess file to redirect all traffic to the public subfolder. Of course, I have excluded the file from rewriting (it is accessible from the browser I checked):
RewriteRule ^(file).* - [L]
Why is that?