9

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?

1
  • Go to permission tab in folder properties and give access to Everyone and try it Nov 17, 2021 at 6:42

2 Answers 2

25

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

4
  • 2
    this not for windows ! Aug 14, 2021 at 17:48
  • this worked for me on centos 8. but can you explain what "ugo+rw" does? Jul 20, 2022 at 16:34
  • works perfectly on macOs
    – Eben Watts
    Nov 2, 2022 at 2:33
  • This is 777 and risky
    – EmptyData
    Aug 1 at 14:26
-1

I have solved this problem by deleting this file

storage/logs/laravel.log

After deleting this file I have run the command

php artisan optimize:clear

-> this command will remove all cache those have on your system

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.