Skip to main content

Permissions for Laravel storage folder

Comments

10 comments

  • cPanelLauren
    What are the permissions of the folders prior to your changing them?
    0
  • Ramon Pego
    lrwxrwxrwx 1 someusrnme someusrnme 42 Jul 4 16:50 access-logs -> /etc/apache2/logs/domlogs/someusrnme/ drwxr-xr-x 11 root root 4096 Jul 5 16:21 app/ -rw-r--r-- 1 root root 1686 Jul 5 16:21 artisan drwxr-xr-x 3 apache apache 4096 Jul 5 16:21 bootstrap/ -rw-r--r-- 1 root root 2106 Jul 5 16:21 composer.json -rw-r--r-- 1 root root 221447 Jul 5 16:21 composer.lock drwxr-xr-x 2 root root 4096 Aug 30 10:25 config/ drwxr-xr-x 5 root root 4096 Jul 5 16:21 database/ drwxr-x--- 3 someusrnme mail 4096 Sep 2 08:20 etc/ drwx------ 2 someusrnme someusrnme 4096 Sep 1 09:05 logs/ drwxr-x--x 11 someusrnme someusrnme 4096 Sep 2 06:32 mail/ -rw-r--r-- 1 root root 1125 Jul 5 16:21 package.json -rw-r--r-- 1 root root 1138 Jul 5 16:21 phpunit.xml drwxr-xr-x 7 root root 4096 Jul 5 16:21 public/ drwxr-x--- 3 someusrnme someusrnme 4096 Jul 4 16:39 public_ftp/ drwxr-x--- 4 someusrnme someusrnme 4096 Jul 4 16:42 public_html/ -rw-r--r-- 1 root root 4094 Jul 5 16:21 readme.md drwxr-xr-x 6 root root 4096 Jul 5 16:21 resources/ drwxr-xr-x 2 root root 4096 Aug 30 15:03 routes/ -rw-r--r-- 1 root root 563 Jul 5 16:21 server.php drwxr-xr-x 5 someusrnme someusrnme 4096 Jul 4 16:39 ssl/ drwxrwxrwx 5 apache apache 4096 Jul 5 16:21 storage/ drwxr-xr-x 4 root root 4096 Jul 5 16:21 tests/ drwxr-xr-x 7 someusrnme someusrnme 4096 Jul 8 09:37 tmp/ drwxr-xr-x 36 root root 4096 Aug 12 10:00 vendor/ -rw-r--r-- 1 root root 537 Jul 5 16:21 webpack.mix.js lrwxrwxrwx 1 someusrnme someusrnme 11 Jul 4 16:39 www -> public_html/
    Today I had this same problem with a website It was not opening at all. I had to sort it out quickly, I gave 777 permission on the entire folder, knowing it wasn't ideal but I needed it online.
    0
  • cPanelLauren
    Why is so much of this owned by the root user? I assume that this folder you're showing is the output of what's present in /home/$user/
    and most of this should have the user/group of the user. You might want to look at running something like this to fix the ownership/permissions issues:
    0
  • Ramon Pego
    But, with permissions for the user group, will it be impacted on the web system permission? The big problem is the site create files like log and cache for example
    0
  • cPanelLauren
    I'm not sure I understand the question here. All files associated with the account should be owned by the user/group belonging to that user or they will not be able to run.
    0
  • Ramon Pego
    :
    0
  • meganjoe45
    I am facing this problem too.
    0
  • Ramon Pego
    My biggest problem is that I commonly access, create and change something with the WHM root user. I have several clients and making this change in each user is a painful process, but this script solves the problem or even a [CODE=bash]chown -R user:user laravel / folder
    also solve, but while I use the root user I will have this problem, but I am already working on a more correct way to do this
    0
  • cPanelLauren
    You should definitely not be using the root user when adding files to a user - this isn't a "problem" per say it's the default functionality, you should be using sudo to access items owned by that user
    0
  • Ramon Pego
    yes, I noticed that when you said earlier about having so much content owned by the root user. my mistake. thanks so much about this
    0

Please sign in to leave a comment.