We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

ERROR: SQLSTATE[HY000] [14] unable to open database file

im trying to create a model via: phalcon model mymodel and i get ERROR: SQLSTATE[HY000] [14] unable to open database file

i setup my sqlite3 database settings in app/config/config.php and the app seems to find it but not the phalcon dev tool

when i check the manual tutorial
https://docs.phalcon.io/en/3.3/tutorial-base they controversy put the database config info into the bootstrap public/index.php file so where is now the place to put the access info?

Hi @veto you are free to create your own bootstrap and locate the config files, modules, etc where you want

Look some examples in mvc repo

Good luck

This strikes me as a permissions issue. What user owns the sqllite file? If it was created by your app, then it's probably owned by the web server user (ex: www-data). Running that command as yourself - who doesn't own the file - is what's causing the issue.



813

yes! this was exactly the issue. i'm creating the sqlite3 database with a startup script after a checkout.