Symfony: Exception happened in driver: Could not find driver with mysql

I am trying to connect to my database (mysql) which is running on a server (docker). I am programming on Windows.

In my symfony project I did the following: parameters.yml

-> enter correct parameters

config.yml

doctrine:
    dbal:
        driver: pdo_mysql
        host: '%database_host%'
        port: '%database_port%'
        dbname: '%database_name%'
        user: '%database_user%'
        password: '%database_password%'

      

php.ini

extension=php_mysqli.dll
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll

      

After doing all this, I get the following error: An exception occured in driver: could not find driver

Anyone who can help since I tried some of the solutions provided but none worked or was for Linux systems.

+3


source to share


2 answers


You must install mysql: sudo apt install php-mysql



+2


source


Ok, I made a very dumb mistake. I edited the php.ini file, but I did not rename it to php.ini (it was php.ini-prod). Afterwards I just had to put the correct path in the extension_dir and it works.



Hope this helps others.

+1


source







All Articles