Mongo类不会在Yii控制台应用程序中自动加载 [英] Mongo classes not autoloading in Yii console application

查看:39
本文介绍了Mongo类不会在Yii控制台应用程序中自动加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用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):无法打开流:没有这样的文件或目录 在第418行的文件/var/www/yii/framework/YiiBase.php中

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类是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.

这篇关于Mongo类不会在Yii控制台应用程序中自动加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆