This issue is likely due to the fact that the cache folder is being created with the wrong permissions. To fix this, you can modify the permissions of the cache folder to allow the web server user (in this case, Apache/www-data) to write to it.
First, navigate to your project's root directory and run the following command to change the ownership of the storage directory to the web server user:
sudo chown -R www-data:www-data storage
Next, change the permissions of the cache directory to allow the web server user to write to it:
sudo chmod -R 775 storage/framework/cache
This should allow the web server user to write to the cache directory without requiring sudo privileges. If you still encounter issues, you may need to check the permissions of other directories in your project to ensure they are set up correctly.
Note: Be careful when modifying permissions on your server, as incorrect permissions can lead to security vulnerabilities.