[英]Symfony: Could not find driver
我正在运行 symfony 和 xampp。 尝试通过doctrine 框架连接并创建数据库。 当我写doctrine:database:create时,我回答为找不到驱动程序。 但我的 pdo 驱动程序运行良好。 它存在于 phpinfo 中,而且我可以通过pdo构造函数轻松连接到 db。 这是我的 doctrine 配置:
doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'
driver: pdo_mysql
# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
#server_version: '13'
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
我的环境:
DATABASE_URL="mysql://root:@127.0.0.1:3306/aihara"
检查您是否没有另一个 php.ini 禁用 pdo_mysql
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.