PDOException “could not find driver” in php

后端 未结 8 766
误落风尘
误落风尘 2020-12-03 21:11

I have installed Lampp on my linux system, and I am learning symfony2, while trying to create the schema with symfony2 command

php app/console doctrine:sche         


        
相关标签:
8条回答
  • 2020-12-03 22:03

    Hope you are running your project in localhost. In your project folder app/config a file named parameters.ini , Make sure that your Mysql database connection cofiguration is correct. If you are using mysql See database_driver=pdo_mysql is its driver.

    Below is an example.

    database_driver   = pdo_mysql
        database_host     = localhost
        database_port     =
        database_name     = databasename
        database_user     = msqlusername
        database_password = mysqlpassword//if not make blank
    
        mailer_transport  = smtp
        mailer_host       = localhost
        mailer_user       =
        mailer_password   =
    
        locale            = en
    
        secret            = ThisTokenIsNotSoSecretChangeIt
    

    Hope it helps you.

    0 讨论(0)
  • 2020-12-03 22:03

    brew install php70-pdo-pgsql in case you installed php7 on mac with brew and, change php version according to what you have installed.

    0 讨论(0)
提交回复
热议问题