问题描述
我正在使用 Yii &mongodb(YiiMongoDbSuite 扩展),并创建了一个控制台应用程序.但它不起作用给出错误,
I am using Yii & mongodb(YiiMongoDbSuite extension), and created a console application. But its not working giving the error,
include(Mongo.php): 无法打开流:没有那个文件或目录在文件/var/www/yii/framework/YiiBase.php 第 418 行
include(Mongo.php): failed to open stream: No such file or directory in file /var/www/yii/framework/YiiBase.php at line 418
我已将 console.php 配置为包含所有模块、组件和模型.但是还是报错.
I have configure the console.php to include all the modules, components and models. But still giving the error.
推荐答案
Mongo class 是 php mongo 扩展的一部分,与 YiiMongoDbSuite 无关.这意味着未加载 mongo php 扩展.确保您的 cli php 使用了正确的(或任何)php.ini.您可能已经在 httpd.conf 中定义了 ini 路径,但它仅供 apache 使用.
最简单的解决方法是将 php.ini 放入您的 php 文件夹中.
Mongo class is a part of php mongo extension, it is not related to YiiMongoDbSuite. This means that mongo php extension is not loaded. Make sure, that your cli php is using proper (or any) php.ini. You might have defined ini path in httpd.conf, but it is used only by apache.
Easiest fix is to drop php.ini into your php folder.
这篇关于在 Yii 控制台应用程序中不自动加载 Mongo 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)