Using Sqlite3 with CakePHP

后端 未结 1 1221
谎友^
谎友^ 2021-01-03 09:35

I\'m trying to run Sqlite3 with CakePHP. Yes, i know it\'s not officially supported, but this post here: How do I connect CakePHP to a SQLite database? says it\'s possible.

相关标签:
1条回答
  • 2021-01-03 10:14

    The driver file should be named dbo_sqlite3.php. You can download the latest version from GitHub.

    Your database config could look like this:

    var $default = array(
        'driver' => 'sqlite3',
        'database' => 'database.sqlite'
    );
    

    CakePHP will look for the database file in app/webroot. You can use an absolute path or a path relative to the webroot directory. For example, if you'd rather store the database in the app directory (one level up from the webroot), you could write:

    'database' => '../database.sqlite'
    
    0 讨论(0)
提交回复
热议问题