使用Laradock(基本上是用于Laravel开发的set toog Docker镜像),在PHP中调用Class 'MongoId' not found
时,我一直收到new \MongoId( $id )
FatalThrowableError错误。
这篇文章Class 'MongoId' not found (Zend Framework with MongoDB Doctrine)表明给出错误的原因是没有启用PHP Mongo扩展。
但是,如果我查看phpinfo()
输出,我可以看到mongodb部分。这不意味着它已经启用了吗?
还有什么可能导致此错误?
答案 0 :(得分:12)