PHP PDO exception: could not find driver

前端 未结 3 1664
天涯浪人
天涯浪人 2020-12-19 09:07

Does the MySQL-server and PHP5-MySQLi version have to match in order for a connection to be possible? I\'m currently receiving the error below: I am running BSD. \"Fatal e

相关标签:
3条回答
  • 2020-12-19 09:46

    Thanks to zerkms and John C for pointing me in the right direction. Below are the commands I used to install the driver:

    #cd /usr/ports/databases/php5-pdo_mysql
    #make install clean
    #apachectl restart
    
    0 讨论(0)
  • 2020-12-19 09:50

    I had this same issue on my CentOS install. I had tried to install imagick and hosed my install. When I removed all of my php files and reinstalled something wasn't working right.

    I ran:

    yum install php-pdo
    yum install php-pdo_mysql
    

    After doing those two lines I ran

    service httpd restart
    

    and everything came back up and running.

    0 讨论(0)
  • 2020-12-19 10:02

    PDO uses database specific drivers to connect to database systems. It looks like you are missing the pdo_mysql driver that is required to connect to a MySQL database. There is some details on installing the driver on the pdo_mysql manual page, or there may be a BSD package that you can use (I am afraid I'm not familiar enough with BSD to offer specific advice).

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