'storage\logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

I have developed my application in Laravel 8, it's working fine in localhost and Linux server. But When I deployed it in Plesk Windows Server it's showing permission denied error.

UnexpectedValueException The stream or file "C:\inetpub\vhosts\rcns.edu.pk\Admission.rcns.edu.pk\storage\logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

I cannot run such commands in SSH because my sever PLesk is windows server.

What should I do now?



Solution 1:[1]

Use this command it's works in my case

sudo chmod -R ugo+rw storage

the solution from: https://laracasts.com/discuss/channels/laravel/laravel-the-stream-or-file-storagelogslaravellog-could-not-be-opened-in-append-mode-failed-to-open-stream-permission-denied?page=1&replyId=724250

Solution 2:[2]

if you are using ubuntu, you can give the permission by running this command,

sudo chmod -R ugo+rw storage

It works fine for me. Hope this would help.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman
Solution 2 Pich