1

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

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:

'default' => 'pgsql'

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

PS:是的,我的 pdo_pgsql 包括在内并且可以正常工作(经过测试)。

4

1 回答 1

0

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

于 2013-10-14T07:48:40.277 回答