2017-02-26 74 views
0

我用的是XAMPP 32位PHP 7.1.1如何解決不支持的驅動程序[mongodb]?

我對我的窗戶安裝的MongoDB 3.4.2(Windows 8的親64位)

而且我也有安裝驅動程序(php_mongodb.dll)

我從這裏得到:https://pecl.php.net/package/mongodb/1.2.5/windows(7.1線程安全(TS)86)

但是,我的系統執行時,還存在錯誤:

誰ops,貌似出了問題。

1/1 InvalidArgumentException在ConnectionFactory.php線278: 不支持的驅動器[mongodb的]在 ConnectionFactory->的createConnection( 'mongodb的',對象(閉合),ConnectionFactory.php線278 'myappdb', '' ,數組('driver'=>'mongodb','host'=>'127.0.0.1', 'port'=>'27017','database'=>'myappdb','username'=>'',在ConnectionFactory.php行中使用'password'=>'','options'=> array('database'=>'admin'),'prefix' =>'','name'=>'mongodb')) 64在ConnectionFactory-> createSingleConnection(array('driver'=>'mongodb', 'host'=>'127.0.0.1','port'=>'27017','database'=>'myappdb', ' username'=>'','passwor d'=>'','options'=> array('database'=> 'admin'),'prefix'=>'','name'=>'mongodb'))in ConnectionFactory.php line 50在 ConnectionFactory-> make(array('driver'=>'mongodb','host'=> '127.0.0.1','port'=>'27017','database'=>'myappdb','username '=> '','password'=>'','options'=> array('database'=>'admin'), 'prefix'=>'','name'=>'mongodb') ,'mongodb')in DatabaseManager.php第176行 DatabaseManager.-> makeConnection('mongodb')DatabaseManager.php行 68 at DatabaseManager-> connection('mongodb')in Model.php line 3351 at Model: :Model.php第3317行中的resolveConnection('mongodb') Model.php中的Model-> getConnection() p行395在 model-> newBaseQueryBuilder()在Model.php行1834在 Model-> newQueryWithoutScopes()Model.php行1450在Model-> save() 在ReviewController.php行31在ReviewController-> index ()at Controller.php中的數組(()(array(object(ReviewController),'index'), array()) at RouteDispatcher-> dispatch(object(Route), object(ReviewController),'index')in Route.php line 189 at Route-> runController()in Route.php line 144 at Route-> run(object (Request))在Router.php行653中 Router-> Illuminate \ Routing {closure}(object(Request))in Pipeline.php Pipeline-> Illuminate \ Routing {closure}(object(Request))中的第53行SubstituteBindings.php第41行 Pipeline中的SubstituteBindings-> handle(object(Request),object(Closure))。在 Pipeline.php line 33 at Pipeline-> Illuminate \ Routing {closure}(object(Request)) Authenticate.php line Pipeline-> Illuminate \ Pipeline {closure}(object(Request)在Pipeline.php行137中進行Authenticate-> handle(object(Request), object(Closure)),在 管道中管道 - >照亮\ Pipeline {closure}(object(Request))。在 Pipeline.php行 VerifyCsrfToken-> handle(object(Request),object(Closure))中的 VerifyCsrfToken.php 65行的管道 - >照亮\路由{closure}(對象(請求)在 管道 - >照亮\路由{閉合}(對象 ShareErrorsFromSession->手柄在 管道在 Pipeline.php線33(對象(請求),對象(封閉))在 Pipeline.php線137在 Pipeline->照亮\管道{閉合}(對象(請求)) - >照亮\路由{閉合}(鄰(請求)) StartSession.php第64行在StartSession-> handle(object(Request), object(Closure))在Pipeline.php行137在 Pipeline-> Illuminate \ Pipeline {closure}(object(Request )) Pipeline.php line 33 at Pipeline-> Illuminate \ Routing {closure}(object(Request))in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse-> handle(object(Request),object(Closure)) in Pipeline.php line 137 at Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in Pipeline.php line 33 at Pipeline-> Illuminate \ Routing {closure}(object(Request))in EncryptCookies-> handle(object(Reque管道 - >照亮\管道{關閉}(對象(請求))在 Pipeline.php第33行在 管道 - >照亮\路由{關閉})在Pipeline.php線137在 管道 - >照亮\ (對象(請求))在 Pipeline.php line 104在Pipeline-> then(object(Closure))in Router.php line 655 at Router-> runRouteWithinStack(object(Route), object(Request))in Router .php line 629 at Router.php line中的Router-> dispatchToRoute(object(Request))607行 Kernel.php中的Router-> dispatch(object(Request))268行 Kernel-> Illuminate \ Foundation \ Http {closure}(object(Request))in Pipeline.php line 53 at Pipeline-> Illuminate \ Routing {closure}(obj (請求)) Debugbar.php第51行在Debugbar-> handle(object(Request), object(Closure))在Pipeline.php行137在 Pipeline-> Illuminate \ Pipeline {closure}(object(Request )) Pipeline.php line 33 at Pipeline-> Illuminate \ Routing {closure}(object(Request))in CheckForMaintenanceMode.php line 46 at CheckForMaintenanceMode-> handle(object(Request),object(Closure))在 Pipeline.php 137行 Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in Pipeline.php line 33 at Pipeline-> Illuminate \ Routing {closure}(object(Request))in 在Pipeline->然後(對象(閉包))在Kernel.php中的Pipeline.php第104行 線150在內核級> sendRequestThroughRouter中的index.php 線 Kernel.php線117(對象(請求))在內核級>手柄(對象(請求))53

我似乎已經安裝驅動程序正確,但爲什麼仍然存在錯誤

我該如何解決?

+0

只是猜測,但你的驅動程序是x86!= x64像你的mongodb? – Myonara

+0

@Myonara,我使用驅動程序32位,因爲我的版本xampp是32位。它應該是一樣的。我的mongodb支持32位&64位。看看這個:https://www.mongodb.com/download-center?jmp=nav#community –

回答

0

我認爲Laravel正在尋找一個數據庫驅動程序,而不是PHP驅動程序。確保你已經安裝了一個PHP軟件包,它將橋接MongoDB的數據庫連接,並且配置正確。

+0

我更改爲xampp 32位PHP 7.0.8,它的工作原理。 xampp 32位PHP 7.1.1似乎有問題 –

相關問題