如何解决不支持的驱动程序[mongodb]?

时间:2017-02-26 17:39:25

标签: php mongodb laravel dll laravel-5.3

我使用xampp 32位PHP 7.1.1

我在我的Windows上安装了mongodb 3.4.2(Windows 8 pro 64位)

我还安装了驱动程序(php_mongodb.dll)

我从这里开始:https://pecl.php.net/package/mongodb/1.2.5/windows(7.1线程安全(TS)x86)

但是,当我的系统执行时,仍然存在错误:

  

糟糕,看起来出了问题。

     

ConnectionFactory.php第278行中的1/1 InvalidArgumentException:   ConnectionFactory.php第278行中不支持的驱动程序[mongodb]   ConnectionFactory-> createConnection(' mongodb',object(Closure),   ' myappdb','',数组('驱动程序' =>' mongodb','主机' => ;' 127.0.0.1',   '端口' => ' 27017','数据库' => ' myappdb','用户名' => '&#39 ;,   '密码' => '','选项' =>数组('数据库' =>'管理员'),'前缀'   => '',' name' => ' mongodb'))ConnectionFactory中的ConnectionFactory.php第64行 - > createSingleConnection(数组(' driver' =>' mongodb',   '主机' => ' 127.0.0.1',' port' => ' 27017','数据库' => ' myappdb&#39 ;,   '用户名' => '','密码' => '','选项' =>数组('数据库' =>   ' admin'),'前缀' => '',' name' => ' mongodb')in   ConnectionFactory.php第50行   ConnectionFactory-> make(array(' driver' =>' mongodb',' host' =>   ' 127.0.0.1',' port' => ' 27017','数据库' => ' myappdb','用户名' =>   '','密码' => '','选项' =>数组('数据库' =>' admin'),   '前缀' => '',' name' => ' mongodb'),' mongodb')in   DatabaseManager.php第176行   DatabaseManager-> makeManager(' mongodb')在DatabaseManager.php行中   68在DatabaseManager->连接(' mongodb')在Model.php第3351行   模型:: resolveConnection(' mongodb')在Model.php第3317行中   Model-> getConnection()在Model.php第395行中   Model-> newBaseQueryBuilder()在Model.php第1834行中   模型 - > newQueryWithoutScopes()在Model.php第1450行的Model-> save()   在ReviewController.php第31行的ReviewController-> index()at   call_user_func_array(array(object(ReviewController),' index'),   Controller.php第55行中的array())在Controller-> callAction(' index',   arrayDispatcher.php第44行中的array())   ControllerDispatcher->调度(对象(路线),   对象(ReviewController),'索引')在Route.php第189行中   Route-> runController()在Route.php第144行at   路由 - >运行(对象(请求))在Router.php第653行中   在Pipeline.php中的Router-> Illuminate \ Routing {closure}(object(Request))   管道上的第53行 - > Illuminate \ Routing {closure}(object(Request))in   SubstituteBindings.php第41行at   SubstituteBindings-> handle(object(Request),object(Closure))in   Pipeline.php第137行   Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in   Pipeline.php第33行   Pipeline-> Illuminate \ Routing {closure}(object(Request))in   在Authenticate->句柄中验证.php第43行(对象(请求),   object(Closure))在Pipeline.php第137行中   Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in   Pipeline.php第33行   Pipeline-> Illuminate \ Routing {closure}(object(Request))in   VerifyCsrfToken.php第65行at   VerifyCsrfToken-> handle(object(Request),object(Closure))in   Pipeline.php第137行   Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in   Pipeline.php第33行   Pipeline-> Illuminate \ Routing {closure}(object(Request))in   ShareErrorsFromSession.php第49行at   ShareErrorsFromSession-> handle(object(Request),object(Closure))in   Pipeline.php第137行   Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in   Pipeline.php第33行   Pipeline-> Illuminate \ Routing {closure}(object(Request))in   在StartSession->句柄的StartSession.php第64行(对象(请求),   object(Closure))在Pipeline.php第137行中   Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in   Pipeline.php第33行   Pipeline-> Illuminate \ Routing {closure}(object(Request))in   AddQueuedCookiesToResponse.php第37行   AddQueuedCookiesToResponse->句柄(对象(Request),对象(Closure))   在Pipeline.php第137行中   Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in   Pipeline.php第33行   Pipeline-> Illuminate \ Routing {closure}(object(Request))in   EncryptCookies.php第59行在EncryptCookies->句柄(对象(请求),   object(Closure))在Pipeline.php第137行中   Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in   Pipeline.php第33行   Pipeline-> Illuminate \ Routing {closure}(object(Request))in   Pipeline.php第104行在Pipeline->然后(对象(Closure))在Router.php中   路由器的第655行> runRouteWithinStack(对象(路由),   对象(请求))在Router.php第629行中   Router.> dispatchToRoute(object(Request))在Router.php第607行中   Router->在Kernel.php第268行中的dispatch(对象(Request))   Kernel-> Illuminate \ Foundation \ Http {closure}(object(Request))in   Pipeline.php第53行   Pipeline-> Illuminate \ Routing {closure}(object(Request))in   在Debugbar-> handle(对象(请求),Debugbar.php第51行,   object(Closure))在Pipeline.php第137行中   Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in   Pipeline.php第33行   Pipeline-> Illuminate \ Routing {closure}(object(Request))in   CheckForMaintenanceMode.php第46行   CheckForMaintenanceMode-> handle(object(Request),object(Closure))in   Pipeline.php第137行   Pipeline-> Illuminate \ Pipeline {closure}(object(Request))in   Pipeline.php第33行   Pipeline-> Illuminate \ Routing {closure}(object(Request))in   Pipeline.php第104行在Pipeline->然后(object(Closure))在Kernel.php中   在内核的第150行 - > sendRequestThroughRouter(对象(请求))中   在index.php中的Kernel->句柄(对象(请求))中的Kernel.php第117行   第53行

我似乎已经正确安装了驱动程序,但为什么仍然存在错误

我该如何解决?

1 个答案:

答案 0 :(得分:0)

我认为Laravel正在寻找数据库驱动程序,而不是PHP驱动程序。确保您已安装PHP包,它将桥接MongoDB的数据库连接并且已正确配置。