I gave permissions to read and write files in /var/www
to the working user(me) through the steps given in Whats the simplest way to edit and add files to “/var/www”?. It works fine when I try to create/read file in the project directory.
Say I am working in /var/www/xyz
I am able to read and write files in this folder through a php
code. Now, I have created a folder inside folder xyz
, say abc
/var/www/xyz/abc
In my php
code when I read a file situated inside abc
, it works fine, but it gives me warning: permission denied
when I try to create a file in this folder.
The exact warning is
Warning: fopen(abc/a.txt): failed to open stream: Permission denied in /var/www/xyz/code.php
I was asked to provide some output:
stat /var/www/dodge
File var/www/dodge'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 700h/1792d Inode: 1445503 Links: 8
Access: (2775/drwxrwsr-x) Uid: ( 33/www-data) Gid: ( 33/www-data)
Access: 2013-07-16 16:29:21.434531583 +0530
Modify: 2013-07-16 14:07:46.482782580 +0530
Change: 2013-07-16 16:28:04.622533850 +0530
Birth: -
stat /var/www/xyz/abc
File: /var/www/dodge/codes'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 700h/1792d Inode: 1446465 Links: 2
Access: (0775/drwxrwxr-x) Uid: ( 1000/ wq) Gid: ( 1000/ wq)
Access: 2013-07-16 15:16:15.554661170 +0530
Modify: 2013-07-16 15:13:42.698665686 +0530
Change: 2013-07-16 15:13:42.698665686 +0530
Birth: -
stat /var/www/xyz /var/www/xyz/abc
?xyz
has socket(s) permission. But the directoryabc
only has directory(d) permission.ls -l
output on the folder in question as an edit to your question.