国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Laravel: 錯誤 [PDOException]: 在 PostgreSQL 中找不到驅(qū)動程序
P粉722409996
P粉722409996 2023-07-31 18:16:43
0
2
1137
<p>Translate: "我正在嘗試通過Laravel連接到PostgreSQL數(shù)據(jù)庫,以便執(zhí)行php artisan migrate命令,但似乎沒有成功,因為它正在讀取MySQL的數(shù)據(jù)庫名稱。<br /><br />以下是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>如果我刪除MySQL的路徑,我會得到:</p> <pre class="brush:php;toolbar:false;">[InvalidArgumentException] Database [mysql] not configured.</pre> <p><br /></p><hr /> <strong>Translate: "編輯:當嘗試執(zhí)行 php artisan migrate 命令時,我遇到了 'PDOException: could not find driver' 錯誤。我正在使用 WAMP 并且在 Windows 8.1 上。數(shù)據(jù)庫使用的是 PostgreSQL。"</strong><p><br /></p> <p><br /></p><hr /> <strong>EDIT:</strong> Translate: "我已經(jīng)嘗試了一系列的替代解決方案,但問題仍未解決。已經(jīng)檢查了 Apache、WAMP(來自 php 文件夾)和 PostgreSQL 中的 php.ini 文件。extension_dir 設置正確,如下所示 -> extension_dir = "c:/wamp/bin/php/php5.5.12/ext/"。extension=pdo_pgsql.dll 和 extension=pgsql.dll 已經(jīng)被取消注釋。<br /><br />已經(jīng)在 '系統(tǒng)變量' 中進行了 PATH 的設置,并重新啟動了計算機。但是仍然沒有成功。<br /><br />感謝迄今為止的幫助。<br /><br />這是我的驅(qū)動程序 php_pdo_driver.h 和 php_pdo.h 位于 C:Program Files (x86)PostgreSQLEnterpriseDB-ApachePHPphpSDKincludeextpdo<br /><br />從 phpinfo 中獲取的信息:<br /><p><br /></p> <blockquote> <p>Translate: "PHP 版本 5.5.12<br /><br />編譯器 MSVC11 (Visual C++ 2012) 配置命令 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>
P粉722409996
P粉722409996

全部回復(2)
P粉043295337

"對于 PDOException: could not find driver for MySQL 錯誤,如果是基于 Debian 的操作系統(tǒng)

sudo apt-get -y install php5-mysql
P粉037450467

Translate: "Be sure to configure the 'default' key in app/config/database.php.

對于PostgreSQL,配置應該是 'default' => 'postgres'。

如果您收到 [PDOException] could not find driver 錯誤,請檢查您是否安裝了正確的PHP擴展。您需要安裝并啟用 pdo_pgsql.so 和 pgsql.so。如何安裝這些擴展因操作系統(tǒng)而異。

對于Windows,pgsql擴展應該已經(jīng)隨官方PHP發(fā)行版預先下載。只需編輯您的php.ini文件,并取消注釋以下行 extension=pdo_pgsql.so 和 extension=pgsql.so。

此外,在php.ini中,確保 extension_dir 設置為正確的目錄。它應該是您的PHP安裝目錄中名為extensions或ext或類似的文件夾。

最后,將 libpq.dll 從 C:\wamp\bin\php\php5.*\ 復制到 C:\wamp\bin\apache*\bin,并通過WampServer界面重新啟動所有服務。

如果仍然出現(xiàn)異常,您可能需要將PostgreSQL的 \bin 目錄添加到您的PATH環(huán)境變量中。"

  1. System Properties -> Advanced tab -> Environment Variables
  2. 在窗口的下半部分的 '系統(tǒng)變量' 組中,滾動查找并找到 PATH 條目。
  3. 選擇它并點擊編輯。
  4. 在現(xiàn)有條目的末尾,輸入您的 postgres bin 目錄的完整路徑。bin 文件夾應該位于您的 postgres 安裝目錄的根目錄中。
  5. 重新啟動任何打開的命令提示符,或者為了確保,請重新啟動您的計算機。

這樣應該可以解決任何問題。更多信息請參見:

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板