1

In a PHP application that I wrote, I keep getting an error that says:

Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'exception 'PDOException' with message 'could not find driver' in /home/diftx/public_html/dol/sparks/php-activerecord/0.0.1/vendor/php-activerecord/lib/Connection.php:239 Stack trace: #0 /home/diftx/public_html/dol/sparks/php-activerecord/0.0.1/vendor/php-activerecord/lib/Connection.php(239): PDO->__construct('mysql:host=loca...', 'diftx_skcin7', 'thePassword', Array) #1 /home/diftx/public_html/dol/sparks/php-activerecord/0.0.1/vendor/php-activerecord/lib/Connection.php(101): ActiveRecord\Connection->__construct(Object(stdClass)) #2 /home/diftx/public_html/dol/sparks/php-activerecord/0.0.1/vendor/php-activerecord/lib/ConnectionManager.php(33): ActiveRecord\Connection::instance('mysql://diftx_s...') #3 /home/diftx/public_html/dol/sparks/php-activerecord/0.0.1/vendor/php-activerecord/lib/Table.php(103): ActiveRecord\ConnectionManager::get_connection(NULL) #4 /home/diftx/public_html/dol/sparks/php-activerecord/0.0.1/vendor/php-activerecord/lib/Tabl in /home/diftx/public_html/dol/sparks/php-activerecord/0.0.1/vendor/php-activerecord/lib/Connection.php on line 241

Based on this message, I did some research about PDO and can't seem to figure out.

Here is a screenshot from my phpinfo() showing PDO information:

Screenshot from my phpinfo() showing PDO information

When I log into the server via PuTTY and type "php -m" a list of modules appear. In the list is both entries for PDO and pdo_sqlite.

I am somewhat new to server configuration and I simply cannot seem to figure out what I am doing wrong to set this up. Help!

4

1 回答 1

1

就像回答这个问题(我评论了解决方案)。您没有 PDO 使用 MySQL 所需的驱动程序。您需要先安装它们,然后才能将 MySQL 与 PDO 一起使用。

于 2012-03-06T18:11:37.380 回答