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

Joycey's avatar

Database (database/database.sqlite) does not exist. (SQL: PRAGMA foreign_keys = ON;)

I have my database/database.sqlite created.

I have run php artisan make:auth successfully.

I have run php artisan migrate successfully.

Now, on clicking on register, I get the errors: Database (database/database.sqlite) does not exist. (SQL: PRAGMA foreign_keys = ON;)

Kindly help with a fix please.

0 likes
7 replies
siangboon's avatar

try put the full path of "database/database.sqlite" for DB_DATABASE in .env

DB_DATABASE=/home/projectname/database/database.sqlite

5 likes
abkrim's avatar

Is possible has in .env file

DB_DATABASE=laravel # or other

Try use only

DB_CONNECTION=sqlite

Others values for DB_* comment.

Also

touch database/database.sqlite
1 like
massaybah's avatar

why have the entire path of the SQLite database file for the app to work instead of only having the file name ?

"/home/username/Documents/apps/laravelApp/database/database.sqlite" instead of just "database.sql"

Watheq's avatar

you can simply remove the line DB_DATABASE entirely from your .env file and laravel will figure it out for you.

Note that you should name the file like this

database/database.sqlite
1 like

Please or to participate in this conversation.