Laravel: Error [PDOException]: Driver not found in PostgreSQL
<p>Translate: "I'm trying to connect to a PostgreSQL database via Laravel in order to execute the php artisan migrate command, but it doesn't seem to be successful because it's reading the MySQL database name.<br /><br /> ;The following are the commands in database.php:</p><p><br /></p>
<pre class="brush:php;toolbar:false;">'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'postgres',
'username' => 'postgres',
'password' => 'root',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
),</pre>
<p>If I remove the path to MySQL, I get: </p>
<pre class="brush:php;toolbar:false;">[InvalidArgumentException]
Database [mysql] not configured.</pre>
<p><br /></p><hr />
<strong>Translate: "Edit: I encountered a 'PDOException: could not find driver' error when trying to execute the php artisan migrate command. I'm using WAMP and on Windows 8.1. The database is using PostgreSQL."< /strong><p><br /></p>
<p><br /></p><hr />
<strong>EDIT:</strong> Translate: "I have tried a series of alternative solutions but the problem is still not resolved. Have checked php.ini in Apache, WAMP (from php folder) and PostgreSQL File.extension_dir is set correctly as shown below -> extension_dir = "c:/wamp/bin/php/php5.5.12/ext/". extension=pdo_pgsql.dll and extension=pgsql.dll have been uncommented.< br /><br />Have set the PATH in the 'System Variables' and restarted the computer. But still no success.<br /><br />Thanks for the help so far. <br /><br />This is my driver php_pdo_driver.h and php_pdo.h located in C:Program Files (x86)PostgreSQLEnterpriseDB-ApachePHPphpSDKincludeextpdo<br /><br />From phpinfo Information obtained: <br /><p><br /></p>
<blockquote>
<p>Translate: "PHP version 5.5.12<br /><br />Compiler MSVC11 (Visual C 2012) configuration command cscript /nologo configure.js "--enable-snapshot-build" "- -disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:php- sdkoraclex64instantclient10sdk,shared" "--with-oci8=C:php-sdkoraclex64instantclient10sdk,shared" "--with-oci8-11g=C:php-sdkoraclex64instantclient11sdk,shared" "--enable-object-out-dir=../ obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo""</p><p>< ;br /></p>
</blockquote><p><br /></p>