Laravel: ?? [PDOException]: PostgreSQL?? ????? ?? ? ????.
P粉722409996
2023-07-31 18:16:43
<p>??: "php artisan migration ??? ???? ?? Laravel? ?? PostgreSQL ??????? ????? ??? MySQL ?????? ??? ?? ??? ??? ??? ???? ??? ? ????.<br / ><br />??? Database.php? ?????:</p><p><br /></p>
<pre class="brush:php;toolbar:false;">'??' =>
'sqlite' => ??(
'????' => 'sqlite',
'??????' => __DIR__.'/../database/production.sqlite',
'???' => '',
),
'mysql' => ??(
'????' => 'mysql',
'???' => '?????',
'??????' => '??????',
'??? ??' => '??',
'????' => '',
'?? ??' => 'utf8',
'??' => 'utf8_unicode_ci',
'???' => '',
),
'pgsql' => ??(
'????' => 'pgsql',
'???' => '?????',
'??????' => '??????',
'??? ??' => '??????',
'????' => '??',
'?? ??' => 'utf8',
'???' => '',
'???' => '??',
),
'sqlsrv' => ??(
'????' => 'sqlsrv',
'???' => '?????',
'??????' => '??????',
'??? ??' => '??',
'????' => '',
'???' => '',
),
),</pre>
<p>MySQL ??? ???? ??? ?? ??? ?????.</p>
<pre class="brush:php;toolbar:false;">[InvalidArgumentException]
?????? [mysql]? ???? ?????.</pre>
<p><br /></p><?? />
<strong>??: "??: php artisan migration ??? ????? ? ? 'PDOException: ????? ?? ? ????' ??? ??????. ?? Windows 8.1?? WAMP? ???? ????. ??????? PostgreSQL? ???? ????."< /strong><p><br /></p>
<p><br /></p><?? />
<strong>EDIT:</strong> ??: "??? ?? ???? ????? ??? ???? ?????. Apache, WAMP(php ??? ??) ? PostgreSQL ???? php.ini? ??????. Extension_dir? ???????. ??? ?? ???? ?????. -> '??? ??'?? ???? ?? ????? ??? ???? ?????.<br /><br />???? ??? ??? ?????. <br /><br />??? ? ???? php_pdo_driver.h ? php_pdo.h???. C:Program Files (x86)PostgreSQLEnterpriseDB-ApachePHPphpSDKincludeextpdo<br /><br />phpinfo?? ?? ?? : <br /><p><br /></p>
<???>
<p>??: "PHP ?? 5.5.12<br /><br />???? MSVC11(Visual C++ 2012) ?? ?? cscript /nologoconfigure.js "--enable-snapshot-build" "- - ????-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:php- sdkoraclex64instantclient10sdk ,??" "--with-oci8=C:php-sdkoraclex64instantclient10sdk,??" "--with-oci8-11g=C:php-sdkoraclex64instantclient11sdk,??" "--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>
"PDOException? ??: Debian ?? ?? ??? ?? MySQL ??? ????? ?? ? ????
????
?? +0
P粉722409996
??: "app/config/database.php?? '??' ?? ???? ???.
PostgreSQL? ?? ??? '??' => 'postgres'?? ???.
[PDOException]? ???? ? ? ???? ???? ??? ????. ??? PHP ??? ???? ??? ?????. pdo_pgsql.so ? pgsql.so? ???? ????? ???. ??? ??? ???? ??? ?? ??? ?? ????.
Windows? ?? pgsql ??? ?? ???? ????. ?? ??? PHP ???? ?? ?????? ?????. php.ini ??? ???? ?? ?? Extension=pdo_pgsql.so ? Extension=pgsql.so? ?? ?????.
?? php.ini?? Extension_dir? ???? ???? ??? ?????. ??? ???????. .it? PHP ?? ????? ?? ??? ?? ext ?? ?? ??? ???? ???.
????? libpq.dll? C:wampbinphpphp5.*?? C:wampbinapache*bin?? ???? WampServer ?????? ?? ?? ?? ?????.
?? ??? ???? ?? PostgreSQL? bin ????? PATH ?? ??? ???? ? ?? ????.
??? ?? -> ?? ? ->
? ??? ?? '??? ??' ???? ????? PATH ??? ????.
???? ??? ?????. -
?? ?? ?? postgres bin ????? ?? ??? ?????. bin ??? postgres ?? ????? ??? ??? ???. -
?? ?? ?? ?? ????? ?? ?????, ??? ?? ???? ?? ?????. -
- ??? ?? ?? ??? ??? ????. ??? ??? ??? ?????.
-
http://php.net/manual/en/install.pecl.windows.php
- http://webcheatsheet.com/php/install_and_configure.php#extsetup
?? +0
P粉722409996