我想将我的项目升级到symfony 4,但条令似乎找不到查找数据库所需的mssql驱动程序。
$ php bin/console doctrine:database:create --env=dev
In AbstractMySQLDriver.php line 125:
An exception occurred in driver: could not find driver
最突出的是,错误发生在MySQLDriver中。php,而我明确告诉symfony我想使用sqlsrv驱动程序。
这是我的信条。yaml设置:
parameters:
# Adds a fallback DATABASE_URL if the env var is not set.
# This allows you to run cache:warmup even if your
# environment variables are not available yet.
# You should not need to change this value.
env(DATABASE_URL): 'sqlsrv://my_user:my_password@my_host/my_dbname'
doctrine:
dbal:
# configure these for your database server
driver: 'sqlsrv'
host: 'my_host'
user: 'my_user'
password: 'my_password'
dbname: 'my_dbname'
port: 'null'
#server_version: '5.7'
#charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
url: '%env(resolve:DATABASE_URL)%'
phpinfo显示可以找到驱动程序
[更新]
webapp显示了一个更清楚的错误。出于某种原因,它正在加载某种默认设置。