2013-10-12 84 views
1

我試着去完成從Laravel快速安裝指南,但使用的工匠數據庫工具,我得到了以下錯誤時:Laravel工匠無視我的應用程序/配置/ database.php中

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' 

配置的Postgres由工匠在某種程度上忽略了我的配置?有什麼簡單的方法來強制他使用自定義配置文件?

PS:是的我有我的pdo_pgsql包括和工作(測試)。

+0

你有'php5-pgsql'擴展名嗎?你在運行什麼操作系統? – Marwelln

+0

我正在運行Fedora 18,我有最新版本的php-pgsql。我測試了'PDO(「pgsql:host = localhost; dbname = test」,「username」,「password」);'和它的工作。 –

回答

0

運行後composer update工匠開始正確使用我的配置。

+1

還要確保你沒有使用多個版本的PHP,這就是我通過'phpbrew'所做的,所以作曲家使用的是通過phpbrew而不是系統版本安裝的PHP版本 –