I am using Laravel's file caching system (at least temporarily) to cache numerous smaller, mainly static objects from the database. However, if I use artisan to run some functions (which add/call from the cache) and then try to load a webpage, I get permission errors while trying to access the cache. Same error when done the other way around (view web page and then run artisan).
This is because the cache is owned by me when I run an artisan command, but is owned by apache when run through the webpage.
I have thought of 2 solutions. One, delete all the cache at the beginning and end of all artisan calls (not ideal, loses most of the performance boosts). Or, run all my artisan commands as the apache user (not convenient, and maybe not even possible).
Is there a way to modify the permissions automatically of Laravel's file caching? Or set artisan's caching to use the apache user maybe?