How to use sqlite database on symfony2 project?

前端 未结 5 1215
温柔的废话
温柔的废话 2020-12-29 05:14

In a Symfony2 project, you can configure the databases connections at the app/config/parameters.ini file. Documentation states that you can use, among others, sqlite3 PDO dr

5条回答
  •  孤城傲影
    2020-12-29 05:50

    Mainly the file path or the file path permisssion will have issue.

    In config.yml, set path to full path like

    /home/{name}/NB/PHP/Symfony/test/src/Database/data.db3

    Dont give %database_path% or what ever. Try this it will work.

    If it works you can give as

    %kernel.root_dir%/../src/Database/%database_path%

    Also check sqlite is ok by

    phpinfo(INFO_MODULES);

    In view/output you can see pdo_sqlite and its version.

提交回复
热议问题