How can I make website with CRUDBooster and Laravel working? - laravel

Website based on CRUDBooster and Laravel not working
Tried to change permissions to main directory -r 777
(1/1) UnexpectedValueException The stream or file
"/var/www/storage/logs/laravel.log" could not be opened: failed to
open stream: Permission denied
I'm having this error when I'm trying to access website build with CRUDBooster and Laravel. Already tried to change permissions to 775 and 777 to all folders and subfolders inside but still same error.
Any idea?
Thank you in advance!

You need to give right permissions to storage and bootstrap/cache folders (sudo chmod -R 775 storage and sudo chmod -R 775 bootstrap/cache) and give right group permission to project folder (sudo chown -R $USER:www-data projectFolder). This last one (group permission) is for Apache server7

Related

Laravel - Every new day I have this error : failed to open stream: Permission denied

i tried by giving permission (775) to bootstrap/cache and storage folder - it works fine on that day but next day it gives error again with new created log file.
The stream or file "/var/www/public_html/myProject/storage/logs/laravel-2021-03-31.log" could not be opened in append mode: failed to open stream: Permission denied in /var/www/public_html/myProject/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:111
i found the solution here:
i have two users on linux server
1 : ubuntu
2 : www-data
i added ubuntu user to www-data group and same as wwww-data to ubuntu group.
so now both users can read there files,
second thing i did is -> i updated app/config/logging.php
and define the permissions (0666) for newly created log file for "daily" and "single".
This might help you:
sudo chown -R www-data:www-data /var/www/{laravel_project_name}
link:
https://dev.to/613596/permission-denied-for-laravel-8-storage-logs-solved-2021-12ld
You have permission issue in your path /var/www/public_html/myProject/storage/logs/.
Try to run the following command
Change the files/directories group to apache/nginx, I used www-data it's the default user of apache on Ubuntu (Use your http server user/group name instead of www-data)
sudo chown :www-data -R /var/www/public_html/myProject/storage/
Now change the file permission once again
sudo chmod 775 -R /var/www/public_html/myProject/storage/
You can also add UID, GID, SID to handle more efficiently

How to solve the problem of accessing the storage in Laravel folder

Faced a problem accessing the storage folder. A symbolic link was created, but when I try to access any file in the storage folder, I get an error 403 "You do not have permission to access this object. The file is not readable, or the server cannot read it." I have a second project on a local machine, everything works fine there. I tried to give 777 permissions to the storage folder, but this causes the "Permisson denied" error. I will be glad to any help!
Macos catalina
Laravel Permissions
first change ownership of the laravel directory to our web group.
sudo chown -R :www-data /var/www/laravel
Next we need to give the web group write privileges over our storage directory so it can write to this folder.
sudo chmod -R 775 /var/www/laravel/storage
where laravel is the name of the root

Error in laravel excel export - touch(): Unable to create file /var/folders/ because Permission denied

I install larvel excel and when i try to get the excel it shows the following error
touch(): Unable to create file /var/folders/wg/vbj_bbf14gl7glz__j1xpvg40000gn/T/laravel-excel-62n8RpljR3nr31FGxE96fwrovKEhXPWT because Permission denied
The excel is looking for a path to store the file temporarily before the data is imported. But the filepath leads to the system that maybe of Xampp or any other host that you are using which doesn't provide you the permission to write.
I solved this by going to excel.php file inside config folder and changing the path to
'local_path' => public_path('imported')
Hope this helps.
Add folders to server user-group and setup permissions to STORAGE + BOOTSTRAP/CACHE [on Apache - question did not state server arch]
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
sudo chgrp -R www-data /var/www/html/example/
sudo chmod -R 775 /var/www/html/example/storage

laravel not showing error but only http:500 error?

i have enabled Laravel debug true and also error in .env and storage folder permission is also 777 and also tried with 0775 but Laravel is not showing cause of 500 error in logs
This error come most of the time because of folder permissions. You need to give permissions 777 recursively to your folders like
sudo chmod 777 laravel/public -R
sudo chmod 777 laravel/storage -R
You can check I hope It will fix the issue, If not then you need to do some more steps in linux. Here is detail: https://rapidsol.blogspot.com/2018/12/how-to-disable-selinux-security.html?q=composer

Laravel does't work in my web host

I uploaded my laravel files to my web host and when i'm trying to access the public folder I get error HTTP ERROR 500.
Couldn't find any logs in my storage/logs/ and the folder is writeable.
Any ideas what can cause this error without any logs?
Try to give those permissions to your project directories bootstrap/cache & storage:
chown -R apache:apache storage
chown -R apache:apache bootstrap/cache
Hope this helps.

Resources