简体   繁体   English

核心警告:模块“ mongodb”已加载

[英]Core Warning: Module 'mongodb' already loaded

Our apps are set up with Laravel and MongoDB, but we're getting a lot of errors relating to Core Warning: Module 'mongodb' already loaded being logged in Sentry.io . 我们的应用程序使用Laravel和MongoDB进行了设置,但是我们遇到了许多与Core Warning: Module 'mongodb' already loaded有关的错误Core Warning: Module 'mongodb' already loaded并记录在Sentry.io

Here are the results from grep -rnw '/etc/php/' -e 'mongodb.so' 这是grep -rnw '/etc/php/' -e 'mongodb.so'

/etc/php/7.2/cli/php.ini:1928:extension=mongodb.so
/etc/php/7.2/mods-available/mongodb.ini:1:extension=mongodb.so
/etc/php/7.2/fpm/php.ini:1928:extension=mongodb.so
/etc/php/7.1/mods-available/mongodb.ini:1:extension=mongodb.so
/etc/php/7.3/mods-available/mongodb.ini:1:extension=mongodb.so
/etc/php/7.0/mods-available/mongodb.ini:1:extension=mongodb.so
/etc/php/5.6/mods-available/mongodb.ini:1:extension=mongodb.so

And here are the results from a generic php --ini (notice the error doesn't appear here.) 这是通用php --ini的结果(请注意,该错误未在此处显示。)

PHP 7.2.15-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Feb  8 2019 15:38:01) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

Do I need to remove one of the ini files above? 我需要删除上述ini文件之一吗? If so, which one? 如果是这样,哪一个? I'd previously removed duplicate lines of extension=mongodb.so from cli/php.ini and from fpm/php.ini , but the error continues to show up in our Sentry.io event logs. 我以前从cli/php.inifpm/php.ini删除了extension=mongodb.so重复行,但该错误继续显示在我们的Sentry.io事件日志中。

If php is being run as a web server module, you need to restart the web server itself after you modify php.ini. 如果php作为Web服务器模块运行,则需要在修改php.ini之后重新启动Web服务器本身。 The configuration will not be loaded automatically if you don't do that. 如果不这样做,配置将不会自动加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM