sqlite - 用 sqlite 连接 symfony
问题描述
我的问题可能看起来很傻,但我不知道该怎么做。
我创建了一个 symfony 项目并想将它连接到 sqlite 数据库。
这是我的学说配置
我还设置了 DATABASE_URL 变量。
但是,例如,当我想生成迁移时,我得到错误找不到驱动程序。
我精确地通过下载一个 zip 文件安装了 sqlite。
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_sqlite'
server_version: '5.7'
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
url: '%env(resolve:DATABASE_URL)%'
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
如果有人知道该怎么做,我将非常感激:)
解决方案
要么你的驱动没有正确安装,运行 php -m 看看它是否出现在列表中或者你需要重启你的网络服务器(即使它是嵌入式的 php-symfony 网络服务器)
推荐阅读
- android - Kotlin/Room/Android 错误:在查询可以有空字段的嵌套对象时出错
- sql-server - 如何使用 Pyspark 加快从 Spark 数据帧写入 SQL Server 的速度?
- reactjs - 在 React Chrome 扩展中实现 Google Analytics
- fedora - 为什么spec-file中使用的%systemd_post在安装后没有启用或启动服务?
- sql - 用于从源表创建测试样本数据的 SQL 脚本
- javascript - 如何在 api 调用上获取格式化的响应负载 - vue
- javascript - 如何检查 StimulusJS 中的所有目标值是否已更改?
- java - 如何使用 Arraylist 放置列表元素
- > 在 Java 中的单个列表中
- java - 有没有办法使用流通过对元素进行操作来返回值
- c# - .NET Core 依赖注入容器不调用 Dispose()