Permissions for Laravel storage folder
Hello I am facing a very annoying and recurring problem.
I have some systems using Laravel on my CentOs 6.2
Every time the system tries to create a new file in the folder
for example
~ myapp / storage / *
He gives permission error
Even though I am giving chmod -R 777 storage /
He can create the file on time, but the other day he can't.
Already sought other solutions that is used as ubuntu for example of
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug + rwx storage bootstrap/cache
cause chgrp: invalid group: `www-data'
I searched for an equivalent in CentOs never found.
My server is CentOs CENTOS 6.10 V82.0.11 on apache2
Thx
-
What are the permissions of the folders prior to your changing them? 0 -
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 -
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 -
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 -
I am facing this problem too. 0 -
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 this0 -
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 -
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.
Comments
10 comments