Saving settings error 500

getting a permission issue since upgrading to .73 an then .76 .

current had ./ninjainvoice folder permissions set to 775 www-data but when i try and save a setting it will error out error 500
i also noticed this in payments it will error 500 but will take the payment however it will post the payment as unapplied .

[2022-03-28 00:00:03] production.INFO: updating currencies
[2022-03-28 00:00:03] production.INFO: updating currencies
[2022-03-28 01:00:07] production.ERROR: Unable to create lockable file: /var/www/html/ninja/storage/framework/cache/data/db/d3/dbd349546ec3e87e258c52bb7fdd97a0c336dcdb. Please ensure you have >

when i change to permissions to 777 www-data it works as expected . but i would want to guess that opening all files in the Ninjainvoice folder is not a great idea.


Correct, you never want to use 777. Did you change the ownership recursively?

sudo chown -R www-data:www-data /var/www/html/ninja

yes that was done but before the update when i first installed.
i reran chown -R www-data:www-data /var/www/html/ninja
changed permissions to 775 for /ninja .

what should the permissions be set to ?

@david can you please advise?

sudo chown -R www-data:www-data storage
sudo find ./ -type d -exec chmod 755 {} \;