【问题标题】:MongoDB Class 'MongoDB\Driver\Manager' not found" in Laravel 5.7, php 7.3 (on Ubuntu 20.4 and Apache)Laravel 5.7、php 7.3(在 Ubuntu 20.4 和 Apache 上)中未找到 MongoDB 类 'MongoDB\Driver\Manager'
【发布时间】:2022-01-25 12:12:45
【问题描述】:

我在我的 ubuntu 系统上安装的不同 php 版本(7.2、7.3)上尝试过在 apache 服务器上运行 laravel 5.7 应用程序。在浏览器中点击应用程序网址后,我收到此错误Class 'MongoDB\Driver\Manager' not found 我已经为此奋斗了一段时间,并尝试了很多解决方案,但它仍然存在。我在所有 php 发行版上都安装了 mongodb 扩展。 有趣的是,当我尝试使用 tinker 从数据库中获取记录时,它工作得很好。

【问题讨论】:

  • 你试过重启 apache 和 laravel 优化清除吗?

标签: php laravel mongodb laravel-5


【解决方案1】:

您必须单独安装php扩展;不是图书馆

https://www.php.net/manual/en/mongodb.installation.manual.php

在ubuntu中简单运行

sudo apt-get install php-mongodb

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-20
    • 2018-07-24
    相关资源
    最近更新 更多