Illuminate\Database\QueryException SQLSTATE[HY000]: General error: 1 no such table: cache(Connection: sqlite, SQL: select * from "cache" where "key" = laravel_cache_xxx limit 1).
Issue
Laravel is attempting to interact with the cache through the database driver when the cache
table does not exist. The most likely cause of this error relates to a change in Laravel 11 where the default cache driver changed from file
to database
. In addition, the ENV variable was renamed from CACHE_DRIVER
to CACHE_STORE
.
Solution
While this change is automated by the Laravel 11.x Shift, you may encounter this error if you upgraded manually or did not set the necessary ENV variables.
If you intend to use the database
database, then you should review the docs to ensure you have a migration for the cache
table.
If you use another cache driver, such as file
, ensure you have set the CACHE_STORE
environment variable to file
. For example:
CACHE_STORE=file