What must be writable.
WHAT NEEDS TO BE WRITABLE
The storage directory and its contents The framework's cache directory within it
WHAT DOES NOT
Application code Configuration The public directory contents
WHY THAT MATTERS
Writable code directories allow a compromise to modify your application.
WHAT PERMISSIONS TO SET
The least that allows the web server to write where it must.
WHAT NOT TO SET
Permissions allowing anyone to write, anywhere.
WHY
It is a serious vulnerability and frequently the cause of compromise on shared hosting.
WHAT TO DO IF SOMETHING CANNOT BE WRITTEN
The error names the path.
Correct that specific path rather than broadening permissions generally.
WHAT ELSE TO CHECK
Ownership, which must match the account.
WHAT TO VERIFY AFTER DEPLOYMENT
That logs are being written That compiled templates are created That uploads succeed
WHAT TO AVOID
Setting broad permissions to resolve an error quickly.
That error is then replaced by a compromise.