在/Storage/log 目录中没有现有的目录,其不可构建: 拒绝权限

我有一个问题与我的 Laravel 部署在 OVH 网络服务器上。 后制作 < br >

composer update


php artisan cache:clear


php artisan route:clear


php artisan dump-autoload

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

146864 次浏览

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.

It helped in this thread at laracasts

go to your vagrant

then run

vagrant ssh

php artisan config:cache

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

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

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.

Please run the below commands:

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

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

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

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

This command will clear all your cache

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

Use this

php artisan optimize:clear

You need to run this command from the terminal.

php artisan config:clear
php artisan config:cache

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 :

composer dump-autoload

or sometimes just try :

composer install

this do the two the commands listed above.

Run the following command if you can access your server terminal

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

If you are on shared hosting and cant access the terminal go to your web route file in routes/web.php and make a temporary link such as shown:

Route::get('reset', function (){
Artisan::call('route:clear');
Artisan::call('cache:clear');
Artisan::call('config:clear');
Artisan::call('config:cache');
});

Then go to http://your-domain/reset to execute the commands. there after you can now access your website as normal

Delete bootstrap/cache/config.php from your laravel deployment on the server.

This one-line command solves my issue:

php artisan config:cache

I got the same issue, I change the permissions of the folders inside the the storage folder.

chmod 777 <folder_name>

I'm not sure about this security wise. but this resolve my problem.

I change my file settings to 755 also work for me.

try this

  1. remove your "vendor" folder
  2. Run "composer install" or "composer install --ignore-platform-reqs" on your cmd or terminal
  3. php artisan config:cache
  4. php artisan config:clear
  5. php artisan cache:clear
  6. php artisan route:cache
  7. php artisan view:clear
  8. php artisan config:cache

if you are using linux:

  1. service apache2 restart (just in case)

if you using xammp:

  1. just restart your xammp

You Have to try artisan command in this way

  1. php artisan cache: clear
    
  2. php artisan config:cache
    
  3. php artisan cache: clear