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.
;The following are the commands in database.php:
'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' => '', ), ),
If I remove the path to MySQL, I get:
[InvalidArgumentException] Database [mysql] not configured.
Translate: "PHP version 5.5.12
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""< ;br />
"For PDOException: could not find driver for MySQL error, if it is a Debian-based operating system
Translate: "Be sure to configure the 'default' key in app/config/database.php.
For PostgreSQL, the configuration should be 'default' => 'postgres'.
If you receive a [PDOException] could not find driver error, check that you have the correct PHP extensions installed. You need to install and enable pdo_pgsql.so and pgsql.so. How to install these extensions varies by operating system.
For Windows, the pgsql extension should already be pre-downloaded with the official PHP distribution. Just edit your php.ini file and uncomment the following lines extension=pdo_pgsql.so and extension=pgsql.so.
Also, in php.ini, make sure extension_dir is set to the correct directory. It should be a folder named extensions or ext or similar in your PHP installation directory.
Finally, add libpq. dll from C:\wamp\bin\php\php5.*\ to C:\wamp\bin\apache*\bin and restart all services through the WampServer interface.
If the exception still occurs, you You may need to add PostgreSQL's \bin directory to your PATH environment variable."
This should solve any problem. For more information see: