laravel /storage/logs 中没有现有目录且无法构建:权限被拒绝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/51041196/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 17:54:22  来源:igfitidea点击:

There is no existing directory at /storage/logs and its not buildable: Permission denied

laravellaravel-5permissions

提问by Timothée

I have a problem with my laravel deploiement on a ovh webserver. After made

我在 ovh 网络服务器上的 Laravel 部署有问题。制作后

composer update

php artisan cache:clear

php artisan route:clear

php artisan dump-autoload

I have this answer:
There is no existing directory at /storage/logs and its not buildable: Permission denied
I put all the files on 777 chmod but I have always this answer.

我有这个答案: 我把所有文件都放在 777 chmod 上,但我总是有这个答案。
There is no existing directory at /storage/logs and its not buildable: Permission denied

回答by frankfurt-laravel

Please try the following commands

请尝试以下命令

php artisan route:clear

php artisan config:clear

php artisan cache:clear

Note:In case you are a Homestead & VirtualBox user, please be sure that your VirtualBox is up to date.

注意:如果您是 Homestead & VirtualBox 用户,请确保您的 VirtualBox 是最新的。

It helped in this thread at laracasts

在 laracasts 的这个线程中有所帮助

回答by Aditya Chauhan

Clear the cache and config, then deploy to the live server.

清除缓存和配置,然后部署到实时服务器。

If you've already uploaded to the live server, then you have to follow these steps:

如果您已经上传到直播服务器,那么您必须按照以下步骤操作:

  1. Delete bootstrap/cache/config.php
  2. Delete all log files in storage/logs.
  1. 删除 bootstrap/cache/config.php
  2. 删除storage/logs.

回答by Vikas Rinvi

You don't need to add any permission on the storage file.

您无需为存储文件添加任何权限。

  • The main problem here is in the compiled file, and due to which laravel try to show an error.
  • By default in laravel, storage file not having permission to show in the console (error shows from the error.log file).
  • So the thing you need to fix is to fix compile file. which can be done thought this single command
  • 这里的主要问题是在编译的文件中,并且由于哪个 laravel 尝试显示错误。
  • 默认情况下,在 Laravel 中,存储文件无权在控制台中显示(错误显示来自 error.log 文件)。
  • 所以你需要修复的是修复编译文件。这可以通过这个单一的命令来完成

This command will clear all your cache

此命令将清除所有缓存

- Compiled views
- Application cache
- Route cache
- Configuration cache

Use this

用这个

php artisan optimize:clear

php工匠优化:清除

回答by dijux

After changing local conf i got the same error over and over, try this, probably will help.

更改本地配置后,我一遍又一遍地遇到相同的错误,试试这个,可能会有所帮助。

rm bootstrap/cache/config.php

and then

进而

php artisan cache:clear

depending on your scenario, reloading auto-loader file can solve your issue, for that use :

根据您的情况,重新加载自动加载器文件可以解决您的问题,用于该用途:

php artisan dump-autoload

or sometimes just try :

或者有时只是尝试:

composer install

this do the two the commands listed above.

这执行上面列出的两个命令。

回答by Farid shahidi

go to your vagrant

去你的流浪汉

then run

然后运行

vagrant ssh

无业游民ssh

php artisan config:cache

php工匠配置:缓存

回答by jrran90

If you are using homestead (vagrant) in Laravel then follow the steps @Farid shahidi provided

如果您在 Laravel 中使用宅基地(流浪者),请按照@Farid shahidi 提供的步骤操作

vagrant ssh
cd /home/vagrant/code <-- your file usually resides here; see your Homestead.yaml configuration
php artisan config:cache

回答by joy

You need to run this command from the terminal.

您需要从终端运行此命令。

php artisan config:clear
php artisan config:cache

回答by Eliecer Narvaez

Please run the below commands:

请运行以下命令:

php artisan route:clear
php artisan config:clear
php artisan cache:clear

回答by Tony Okoth

This one worked for me in case your project is located within /var/www/html/

如果您的项目位于 /var/www/html/

sudo chmod -Rf 0777 /var/www/html/{project-name}/bootstrap/cache sudo chmod -Rf 0777 /var/www/html/{project-name}/storage

sudo chmod -Rf 0777 /var/www/html/{project-name}/bootstrap/cache sudo chmod -Rf 0777 /var/www/html/{project-name}/storage

回答by PHP Worm...

Make sure you have storage/logfolder and give 777 permissionto that folder.

确保你有storage/log文件夹并给777 permission那个文件夹。