英文:
How to solve the problem of accessing the storage in Laravel folder
问题
遇到了访问存储文件夹的问题。创建了一个符号链接,但当我尝试访问存储文件夹中的任何文件时,出现了403错误:“您无权访问此对象。文件不可读取,或服务器无法读取它。”我在本地机器上有第二个项目,那里一切正常。我尝试将存储文件夹的权限设置为777,但这导致了“权限被拒绝”错误。我将对任何帮助感到高兴!
MacOS Catalina
英文:
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
答案1
得分: 1
Laravel权限
首先将laravel目录的所有权更改为我们的Web组。
sudo chown -R :www-data /var/www/laravel
接下来,我们需要为Web组授予对我们的存储目录的写权限,以便它可以写入此文件夹。
sudo chmod -R 775 /var/www/laravel/storage
> 这里的 laravel 是根目录的名称。
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论