0

I'm using the built-in php server to setup a server for my slim project, using php -S localhost:8000

Now I've included Monolog with the default config. Whenver I try to write using Monolog I get the following error

There is no existing directory at "/storage/logs" and it could not be created: Read-only file system in /Users/miguel/Code/strava-php/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 172

This is the result of stat storage, showing my current folder permissions.

31361802 drwxrwxrwx 3 miguel staff 0 96 "Aug 16 12:54:22 2020" "Aug 16 12:54:22 2020" "Aug 16 13:08:57 2020" "Aug 16 12:49:30 2020" 4096 0 0 storage

What I've tried

  • Use sudo chmod -R 777 storage/logs
  • Use chown miguel storage/logs
Miguel Stevens
  • 8,631
  • 18
  • 66
  • 125

1 Answers1

0

I think giving permission on the storage folder will solve the problem instead of giving permission only on the logs folder.

sudo chmod -R 777 storage
Anurag
  • 482
  • 6
  • 23