Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

roadrunner89's avatar

php artisan migrate not working

when I type 'php artisan migrate' I get 2 errors:

[Illuminate\Database\QueryException] SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database (SQL: select * from sqlite_master where type = 'table' and name = migrations)

[PDOException] SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database

I am using windows and have sqlite3 installed. Has anyone encountered this/know how to get past it?

0 likes
5 replies
milon's avatar

create a file named database.sqlite in you storage folder.

roadrunner89's avatar

Hi Milon,

Yep I did that before running php artisan migrate. And I also made sure that sqlite was the correct version (v3)

roadrunner89's avatar

Is there anyone who can help with this?? It is extremely frustrating and I have spent the last few days trying to figure it out (to no avail).

thomaskim's avatar

@roadrunner89 This might help you. From stackoverflow...

The problem is that the version of sqlite is different. Laravel uses sqlite3, wheareas the sqlite command on your console might be an earlier version. Run sqlite -version from the command line to check your version - is is probably 2 something. You need to install sqlite3, and you'll find that it is not compatible - i.e. sqlite3 testing.sqlite will produce the same error you are getting from laravel.

roadrunner89's avatar

@thomaskim Thank you for your reply! How do I fix this though? I downloaded sqlite3, and when I type in sqlite3 in the command line the version is SQLite version 3.8.11.1

Please or to participate in this conversation.