How to properly configure file and folder permissions in Laravel?
Hi everyone! I'm new to Laravel and PHP, and I'm having an issue with file permissions. I deployed the project on a local server (OpenServer with Apache and PHP 8.1). Everything is installed, the site opens, but when I try to upload an image via a form or run an artisan command like `php artisan cache:clear`, I get errors:\n\n- "The stream or file "/var/www/project/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied"\n- "file_put_contents(/var/www/project/storage/framework/cache/data/...): failed to open stream: Permission denied"\n\nI already tried setting `chmod 777` on the `storage` and `bootstrap/cache` folders, but it didn't help — the errors still appear. On production hosting, it's the same story. I understand that 777 is bad