skip to Main Content

I have developed a laravel app and host it to my private server using WinSCP. But when I hit myurl it’s showing me The stream or file "/var/www/html/vesMain/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied and if I set APP_DEBUG=flase then it’s showing 500 error``192.168.41.81 is currently unable to handle this request. but I I saw the file permission is 644. I don’t know why this is happening? Can anyone have any suggestion?

2

Answers


  1. Chosen as BEST ANSWER

    I solved my problem using set the permission 777 to storage folder, logs folder and laravel.log file. Then set permission 777 view folder that inside into storage/framework/view and session(storage/framework/session) folder. Finally, clear the route and cache.

    You can simply run those command.

    1. sudo chmod -R 0777 /var/www/html/your_app/storage
    2. sudo chmod -R 0777 /var/www/html/your_app/storage/logs
    3. sudo chmod -R 0777 /var/www/html/your_app/storage/logs/laravel.log
    4. sudo chmod -R 0777 /var/www/html/your_app/storage/framework/view
    5. sudo chmod -R 0777 /var/www/html/your_app/storage/framework/session

    Then just clear cache and route

    1. php artisan cache:clear
    2. php artisan route:clear

  2. Giving 777 permission is not at all a good practice. Its like you are giving authority to anyone to change your code. Try 775

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search