我试图通过laravel与postgresql数据库连接,以便进行php artisan 迁移,但似乎没有定向,因为它正在读取mysql的数据库名称.
以下是来自database ase.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' => '',
),
),
如果我删除MySQL路径,我会得到:
[InvalidArgumentException]
Database [mysql] not configured.
EDIT: When trying to do php artisan migrate I get a 'PDOException: could not find driver'. I'm using WAMP and I'm in Win8.1. Using PostgreSQL as database.
EDIT: Have experimented a series of alternative solutions but I'm still ought to get this solved. The
php.ini
file was checked in Apache, WAMP (from php folder) and PostgreSQL. The extension_dir
is correct as it being -> extension_dir = "c:/wamp/bin/php/php5.5.12/ext/"
extension=pdo_pgsql.dll
和extension=pgsql.dll
是未注释的.
在"系统变量"中完成PATH
个技巧并重新启动.不可能.
谢谢你到目前为止的帮助.
这些是我的司机php_pdo_driver.h
&;php_pdo.h
从C:\Program Files (x86)\PostgreSQL\EnterpriseDB-ApachePHP\php\SDK\include\ext\pdo
来自phpinfo的信息:
PHP版本5.5.12
编译器MSVC11(Visual C++ 2012)配置命令cScript / NCORO