PHP PDO exception: driver could not be found

Is the MySQL server and version of PHP5-MySQLi consistent so that the connection is possible? I am currently getting an error: I am running BSD. "Fatal error: throw exception" PDOException "with the message" could not find driver "..."

Here is the connection information:

$info = "mysql:dbname=myDB;host=localhost";
$user = "dbUser";
$pw = "somePW";
return(new PDO($info, $user, $pw));

Here is my MySQL info:

MySQL server 5.5.24

php5-MySQLi-5.4.3

+5
source share
3 answers

PDO drivers . , pdo_mysql, MySQL. pdo_mysql manual BSD, ( , m BSD, ).

+4

CentOS. imagick . php , - .

:

yum install php-pdo
yum install php-pdo_mysql

service httpd restart

.

+14

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

#cd /usr/ports/databases/php5-pdo_mysql
#make install clean
#apachectl restart
+2
source

All Articles