laravelbrasil / forum

Ama Laravel? Torne se um Jedi e Ajude outros Padawans
GNU General Public License v3.0
252 stars 13 forks source link

PDO "Could not find driver" - Postgres #189

Open RafaelScharf opened 5 years ago

RafaelScharf commented 5 years ago

Então estou seguindo este tutorial: https://blog.digitalocean.com/create-simple-contacts-laravel-postgresql/ e quando chego no passo que é para dar o comando php artisan migrate --seed

Ele me retorna o erro abaixo:

Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = homestead and table_name = migrations and table_type = 'BASE TABLE')

at C:\Users\rafae\OneDrive\Documentos\git\api-laravel\laravel-contacts\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {

664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace: PS C:\Users\rafae\OneDrive\Documentos\git\api-laravel\laravel-contacts> php artisan migrate

Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = homestead and table_name = migrations and table_type = 'BASE TABLE')

at C:\Users\rafae\OneDrive\Documentos\git\api-laravel\laravel-contacts\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {

664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace:

1 Doctrine\DBAL\Driver\PDOException::("could not find driver") C:\Users\rafae\OneDrive\Documentos\git\api-laravel\laravel-contacts\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:31

2 PDOException::("could not find driver") C:\Users\rafae\OneDrive\Documentos\git\api-laravel\laravel-contacts\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:27

Please use the argument -v to see more details.

Ja descomentei a linha " extension=pdo_sqlite extension=pgsql " no meu php.ini que esta no C:/php/php.ini

Mas ainda não funcionou.

diogo4 commented 3 years ago

Hi guy, try this --> https://stackoverflow.com/questions/25329302/laravel-error-pdoexception-could-not-find-driver-in-postgresql