I have an app that is working with Postgres, but the developer tools webtools.php won't work (it's trying to connect to MySQL).
Here is my config.ini:
[database]
host = localhost
username = postgres
password =
name = databasename
schema = public
Here is my index.php
$di->set('db', function() use ($config) {
return new \Phalcon\Db\Adapter\Pdo\Postgresql(array(
"host" => $config->database->host,
"username" => $config->database->username,
"password" => $config->database->password,
"dbname" => $config->database->name,
"schema" => $config->database->schema
));
});
This is the output I get from the webtools (notice #0 is trying to connect to MySQL):
PDOException: could not find driver
#0 [internal function]: PDO->__construct('mysql:host=loca...', 'postgres', '', Array)
#1 [internal function]: Phalcon\Db\Adapter\Pdo->connect(Array)
#2 /var/www/html/phalcon-devtools/scripts/Phalcon/Web/Tools.php(313): Phalcon\Db\Adapter\Pdo->__construct(Array)
#3 [internal function]: Phalcon\Web\{closure}()
#4 [internal function]: Phalcon\DI\Service->resolve(NULL, Object(Phalcon\DI\FactoryDefault))
#5 [internal function]: Phalcon\DI->get('db', NULL)
#6 /var/www/html/phalcon-devtools/scripts/Phalcon/Web/Tools.php(181): Phalcon\DI->getShared('db')
#7 /var/www/html/phalcon-devtools/scripts/Phalcon/Web/Tools/controllers/ControllerBase.php(61): Phalcon\Web\Tools::getConnection()
#8 /var/www/html/phalcon-devtools/scripts/Phalcon/Web/Tools/controllers/ModelsController.php(30): ControllerBase->listTables(true)
#9 [internal function]: ModelsController->indexAction()
#10 [internal function]: Phalcon\Dispatcher->dispatch()
#11 /var/www/html/phalcon-devtools/scripts/Phalcon/Web/Tools.php(322): Phalcon\Mvc\Application->handle()
#12 /var/www/html/project-dir/public/webtools.php(26): Phalcon\Web\Tools::main('/var/www/html/p...', '{my ip}')
#13 {main}
Thanks