2

I am getting an error even after setting permission to 777...

ls -al /var/www/html/supervisory/app/storage
total 32
drwxrwxrwx.  7    777 apache 4096 Apr 16 00:06 .
drwxr-xr-x. 12 apache apache 4096 Apr 16 00:06 ..
drwxrwxrwx.  2    777 apache 4096 Apr 16 00:06 cache
-rwxrwxrwx.  1    777 apache   17 Apr 16 00:06 .gitignore
drwxrwxrwx.  2    777 apache 4096 Apr 16 00:06 logs
drwxrwxrwx.  2    777 apache 4096 May 26 14:47 meta
drwxrwxrwx.  2    777 apache 4096 Apr 16 00:06 sessions
drwxrwxrwx.  2    777 apache 4096 Apr 16 00:06 views

Iam getting an error on the homepage...

ErrorException

file_put_contents(/var/www/html/supervisory/app/storage/meta/services.json): failed      to     open stream: Permission denied
0

1 Answer 1

2

make sure you have the following settings

777 permission for app/storage folder

When you give 777 make sure you do it like this

chmod -R 777 app/storage

755 permission for folders

644 for files

If the error still there check for the ownership, the user is usually www-data

you can check it by creating a file and type in the the following

<?php 
 echo shell_exec('whoami');
?>

after getting the user add the user like this

chown -R www-data:www-data 

If the error is still there try to point your virtual host to public folder, I had had this issue for shared hosting.

8
  • thanks for your response.. after running this comnd chown -R :www-data app/storageIAM GETTING AN ERROR ... chown: invalid group: ‘:www-data’
    – Friend
    May 26, 2014 at 8:46
  • first check who is the user.. and then assign that user. If the user is xxx then the command is chown -R xxx:xxx
    – harikrish
    May 26, 2014 at 8:47
  • before that check if you have the file app/storage/meta/services.json, i dont think it is there
    – harikrish
    May 26, 2014 at 8:48
  • i found it ..its there...i have recreated project so now iam getting Error in exception handler. but the file is present...
    – Friend
    May 26, 2014 at 8:51
  • so the permission issue is not solved? what exception do you get?
    – harikrish
    May 26, 2014 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.