Wamp + Laravel 5.1 + Postgresql

Asked

Viewed 724 times

0

Someone already set up Laravel 5.1 to run on Wamp using postgresql database?

I have an Laravel installation running on a WAMP server, but when running the "php Artisan migrate" command I get the following error:"[Pdoexception]could not find driver". All my Laravel settings are correct, and already test a connection to check if I have installed postgresql correctly and it is also all right. Follow below my settings and tests, if anyone can give me a light I’m grateful:

// database php.

'default' => env('DB_CONNECTION', 'pgsql'), ...

'pgsql' => [
        'driver'   => 'pgsql',
        'host'     => env('DB_HOST', 'localhost'),
        'database' => env('DB_DATABASE', 'forge'),
        'username' => env('DB_USERNAME', 'forge'),
        'password' => env('DB_PASSWORD', ''),
        'charset'  => 'utf8',
        'prefix'   => '',
        'schema'   => 'public',
    ],

.env

DB_HOST=localhost
DB_DATABASE=postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres

teste_psql.php

<?php
$dbconn = pg_connect("host=localhost port=5432 dbname=postgres 
                  user=postgres password=postgres")
      or die('Não foi possível conectar: ' . pg_last_error());
echo 'Conectado: ', pg_dbname($dbconn);
?>
  • Check phpinfo to see if the pgsql driver is installed.

  • Yes, this is all enabled, PDO drivers: mysql, pgsql, sqlite, Postgresql(libpq) Version 9.2.2 Postgresql(libpq) Uninitialized version string (Win32) Multibyte Character support enabled SSL support disabled Active Persistent Links 0 Active Links 0 pdo_pgsql PDO Driver for Postgresql enabled Postgresql(libpq) Version 9.2.2 Module version 1.0.2 Revision $Id$

  • Funny error message says, that php_pdo_pgsql is not installed ...

  • No, he says he couldn’t find the driver. Even if I try a direct PDO connection via TINKER the error is the same: $DBH = new PDO("pgsql:host=localhost;port=5432;dbname=postgres;user=postgres;password=postgres"); Pdoexception with message 'could not find driver'. This same code when run in pure php works normally

  • You have enabled the pdo_pgsql extension in php.ini ??

  • I have enabled everything to enable.... but I solved the problems using Vagrant(https://www.vagrantup.com/)

  • Valentim Araújo - Could you explain how I use Vagrant to solve your problem please.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.