/ storage/logs中没有现有目录且不可构建:权限被拒绝

Tim*_*hée 19 permissions laravel laravel-5

我在一个ovh网络服务器上的laravel deploiement有问题.后作
" There is no existing directory at /storage/logs and its not buildable: Permission denied"
" There is no existing directory at /storage/logs and its not buildable: Permission denied"
"There is no existing directory at /storage/logs and its not buildable: Permission denied
"
"There is no existing directory at /storage/logs and its not buildable: Permission denied
"

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

fra*_*vel 49

请试试

php artisan route:清楚

php artisan配置:清除

php artisan cache:清楚

在laracasts中帮助了这个主题

  • Chanchal:给你 /sf/ask/3656187391/ 是一秒钟的搜索。 (3认同)
  • 这个顺序(路由,配置,然后缓存)对我有用! (2认同)

小智 28

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

如果您已经上传到实时服务器,则必须执行以下步骤:

  1. 删除 bootstrap/cache/config.php
  2. 删除中的所有日志文件storage/logs

  • 共享主机的最佳答案 (3认同)

Vik*_*nvi 21

您不需要在存储文件上添加任何权限。

  • 这里的主要问题是在编译文件中,并且由于该问题,laravel试图显示错误。
  • 在laravel中,默认情况下,存储文件无权在控制台中显示(来自error.log文件的错误显示)。
  • 因此,您需要修复的是修复编译文件。可以通过单个命令来完成

此命令将清除所有缓存

- Compiled views
- Application cache
- Route cache
- Configuration cache
Run Code Online (Sandbox Code Playgroud)

用这个

PHP的工匠优化:清除

  • 您是救生员!我遇到了一些愚蠢的CORS问题,并通过命令解决了。 (4认同)
  • 我很高兴能有所帮助。@AmirrezaNasiri也感谢您的评论。 (2认同)

小智 21

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

rm bootstrap/cache/config.php
Run Code Online (Sandbox Code Playgroud)

进而

php artisan cache:clear
Run Code Online (Sandbox Code Playgroud)

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

composer dump-autoload
Run Code Online (Sandbox Code Playgroud)

或者有时只是尝试:

composer install
Run Code Online (Sandbox Code Playgroud)

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


小智 5

去你的流浪汉

然后运行

无业游民ssh

php工匠配置:缓存


Sof*_*per 5

如果可以访问服务器终端,请运行以下命令

php artisan 路由:清除 && php artisan 缓存:清除 && php artisan 配置:清除 && php artisan 配置:缓存

如果您使用共享主机并且无法访问终端,请转到您的 Web 路由文件routes/web.php并创建一个临时链接,如下所示:

Route::get('reset', function (){
    Artisan::call('route:clear');
    Artisan::call('cache:clear');
    Artisan::call('config:clear');
    Artisan::call('config:cache');
});
Run Code Online (Sandbox Code Playgroud)

然后转到http://your-domain/reset执行命令。之后您就可以正常访问您的网站了