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

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

Related

How can I make website with CRUDBooster and Laravel working?

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

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.

owncloud cannot access directory

I am running Raspbian version 7 on my raspberry pi. I am running owncloud on this. I have mounted an external drive under /media/Owncloud. This is where I have owncloud store all the files. I cannot access this directory. When I try cd /media/Owncloud it gives me the following error:
-bash: cd: /media/Owncloud/: Permission denied
How can I access this directory?
OwnCloud and external hard drives are tricky and you have a permission issue. For some reason, trying to make a link to an external hard drive has issues, so you need to try mounting your external hard drive.
External hard drive - Apply the proper group and read permissions:
chown -R www-data:www-data /media/user/your_hard_drive/owncloud_data/
chmod -R 777 /media/user/your_hard_drive/owncloud_data/
Local hard drive - Apply the proper group and read permissions:
mkdir /var/www/owncloud/data
chown -R www-data:www-data /var/www/owncloud/data
chmod -R 777 /var/www/owncloud/data
Make the mount of local hard drive to external hard drive
mount --bind /media/user/your_hard_drive/owncloud_data/ /var/www/owncloud/data/
Source:
https://manandkeyboard.wordpress.com/2014/09/15/owncloud-and-an-external-hard-drive/
If you just want to cd into the directory, change to root with sudo -i.
In order to access /media/Owncloud, you need to set the proper permissions. Run the command sudo chmod 755 /media/Owncloud(for more security relative to permission 777).
You also may need to allow to webserver to access the directory. In order to do that, run sudo chown -R www-data:www-data /media/Owncloud
Sources:
My own experience and frusteration in running into the exact same problem
http://www.instructables.com/id/Raspberry-Pi-Owncloud-dropbox-clone/?ALLSTEPS A great albeit somewhat outdated guide to set up owncloud on a Raspberry Pi.
The issue is with wrong permissions.
If the webserver runs as user www-data, the mounted folder must be somehow accessible to that user
either that user must be owner of mounted folder and its contents, and have the "user" permissions, or
the the folder must be accessible to the group the webserver user is in (usually www-data).
To see the current permissions use the ls -l command.
To change the owner use chown command,
to change the permissions for the user-owner, and group-owner, use the chmod command,
or just use Midnight commander (mc) or some GUI to do that.
If you are mounting the external volume through /etc/fstab check the options in there. I would not recommend using the volume with some dynamic mounting (like the file managers do (gvfs-fuse)) if is a key folder for a webserver with ownCloud and you need to have it auto-mounted on boot, as some specific user that the webserver is run as.
I have an experience with having the ownCloud data folder on /srv/data (also ownCloud 7.0 on Ubuntu Server 14.04 VPS), the permissions are 770 and the owner is www-data:www-data, and in the ownCloud config file, I use the line
'datadirectory' => '/srv/data',
I would not recommend using 777 permissions, as it is not a good security practice in general.

Mac Lion Apache can't view files in document root

Apache is running, localhost is working, if I put an index.html that works as well. However I can't access any folders (my websites) within the document root, which is /Users/Me/Sites
I get a forbidden error when I try to access these.
What's going wrong?
You should check the permissions of your home folder and your sites directory to make sure that they allow Apache access.
You could check the permissions, or just run (in a Terminal)
chmod o+x $HOME
chmod -R o+rX $HOME/Sites

When I upload my CodeIgniter System to my Amazon EC2, why are all of my permissions messed up?

For some weird reason, my "system" folder has permissions of "000" when I upload it. This totally breaks CodeIgniter as I get all sorts of errors:
Message: CI_Config::include(/[mysite]/system/application/config/assetlibpro.php) [ci-config.include]: failed to open stream: Permission denied
I don't think this is an EC2-specific problem. If you fix the permissions using
chmod -R 755 /[mysite]/system
you should be OK (755 means read/write/execute for owner, read/execute for group and world)

Resources