-3

I'm having some weird problem with Laravel 8.

I installed the framework and started working with it, but when I try to edit / delete some controller, my Ubuntu asks for a password.

Another problem. My controller displays records on a page with paginate(15) pagination, but instead of the usual numbers, I get the Previous & Next direction, and when I try to change something in the html template, I get an error file_put_contents(/var/www/storage/framework/views/c6d615eb91fe3a0edd449165e94d034703bbb84d.php): failed to open stream: Permission denied and this problem can only be cured by clearing the cache, but this should not be the case.

Sergey Karp
  • 31
  • 1
  • 4
  • 1
    Does this answer your question? [How to set up file permissions for Laravel?](https://stackoverflow.com/questions/30639174/how-to-set-up-file-permissions-for-laravel) – Beller Feb 23 '21 at 19:47
  • I have no problems with storage – Sergey Karp Feb 23 '21 at 19:49
  • Sounds like a permission problem where the user which is used to install Laravel is different from the one that runs the webserver. Check which user is running the webserver and which one created the Laravel project – Douwe de Haan Feb 23 '21 at 19:57
  • So this error says:`file_put_contents(/var/www/storage...` maybe you have permission problem. – Beller Feb 23 '21 at 20:02

2 Answers2

0

Error #1: Your user does not have write permissions for those files/directories. Did you use sudo while installing or copying anything? Do you have these files outside of your home directory? (/home/username/)

Error #2: Your webserver (nginx, apache, etc.) probably does not have access to the application's /storage/ directory.

Adrian Gonzales
  • 1,010
  • 6
  • 8
0
  1. SSH into the server.
  2. Navigate to the projects root folder.
  3. Run the following commands to make the directories writable:
    sudo chmod -R gu+w storage/
    sudo chmod -R guo+w storage/
    sudo chmod -R gu+w bootstrap/cache/
    sudo chmod -R guo+w bootstrap/cache/
jeremykenedy
  • 4,150
  • 1
  • 17
  • 25