Laravel工匠无视我的app / config / database.php

时间:2013-10-12 18:59:03

标签: php sql postgresql laravel

我试图从Laravel完成快速安装指南,但在使用工匠数据库工具时出现以下错误:

php artisan migrate --verbose

[PDOException]         
  could not find driver

Exception trace:
 () at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
 PDO->__construct() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
 Illuminate\Database\Connectors\Connector->createConnection() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php:20
 Illuminate\Database\Connectors\MySqlConnector->connect() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:41
 Illuminate\Database\Connectors\ConnectionFactory->make() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:128
 Illuminate\Database\DatabaseManager->makeConnection() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:64
 Illuminate\Database\DatabaseManager->connection() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:169
 Illuminate\Database\Migrations\DatabaseMigrationRepository->getConnection() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:137
 Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:370
 Illuminate\Database\Migrations\Migrator->repositoryExists() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:95
 Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:58
 Illuminate\Database\Console\Migrations\MigrateCommand->fire() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Console/Command.php:108
 Illuminate\Console\Command->execute() at /var/www/html/project/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:244
 Symfony\Component\Console\Command\Command->run() at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Console/Command.php:96
 Illuminate\Console\Command->run() at /var/www/html/project/vendor/symfony/console/Symfony/Component/Console/Application.php:897
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/project/vendor/symfony/console/Symfony/Component/Console/Application.php:191
 Symfony\Component\Console\Application->doRun() at /var/www/html/project/vendor/symfony/console/Symfony/Component/Console/Application.php:121
 Symfony\Component\Console\Application->run() at /var/www/html/project/artisan:59

MySqlConnector上的错误很奇怪,因为我在app/config/database.php:上配置了Postgres

'default' => 'pgsql'

工匠是否忽略了我的配置?有什么简单的方法可以强制他使用自定义配置文件吗?

PS:是的我包含了pdo_pgsql并正在使用(已测试)。

1 个答案:

答案 0 :(得分:0)

运行composer update后,工匠开始正确使用我的配置。