Subject: Connection Error in Windows
Hey... I'm testing activerecord and i have this database connection problem in Windows:
Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'exception 'PDOException' with message 'could not find driver' in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\Connection.php:202 Stack trace: #0 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\Connection.php(202): PDO->_construct('pgsql:host=loca...', 'postgres', '123456', Array) #1 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\Connection.php(99): ActiveRecord\Connection->_construct(Object(stdClass)) #2 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('development') #3 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\Table.php(83): ActiveRecord\ConnectionManager::get_connection(NULL) #4 C:\Program Files (x86)\Apache Sof in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\Connection.php on line 204
I tested the same code at Linux and works...
This is the database connection code:
require_once 'libs/php-activerecord/ActiveRecord.php';ActiveRecord\Config::initialize(function($cfg) { $cfg->set_model_directory('models'); $cfg->set_connections( array('development' => 'pgsql://postgres:123456@localhost/gouveia') );});?>
RESOLVED.
I forgot to install PDO_pgsql extension.
(1-1/1)
June 27 2010
December 20, 2010 00:00
Subject: Connection Error in Windows
Hey... I'm testing activerecord and i have this database connection problem in Windows:
Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'exception 'PDOException' with message 'could not find driver' in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\Connection.php:202 Stack trace: #0 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\Connection.php(202): PDO->_construct('pgsql:host=loca...', 'postgres', '123456', Array) #1 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\Connection.php(99): ActiveRecord\Connection->_construct(Object(stdClass)) #2 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('development') #3 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\Table.php(83): ActiveRecord\ConnectionManager::get_connection(NULL) #4 C:\Program Files (x86)\Apache Sof in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gouveia\libs\php-activerecord\lib\Connection.php on line 204
I tested the same code at Linux and works...
This is the database connection code:
require_once 'libs/php-activerecord/ActiveRecord.php';
ActiveRecord\Config::initialize(function($cfg) {
$cfg->set_model_directory('models');
$cfg->set_connections(
array('development' => 'pgsql://postgres:123456@localhost/gouveia')
);
});
?>