php - Symfony: Could not find driver
Im running symfony with xampp. Trying to connect to and create db trhough doctrine framework. When i write doctrine:database:create im answered with Could not find driver. But my pdo driver works well. It is present in phpinfo, plus i can easily connect to db through the pdo constructor. Here is my doctrine configs:
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
And my env:
DATABASE_URL="mysql://root:@127.0.0.1:3306/aihara"
Answer
Solution:
check if you don't have another php.ini where the pdo_mysql is disabled
Source