PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, March 4, 2022

[FIXED] Mongo classes not autoloading in Yii console application

 March 04, 2022     console, mongodb, php, yii     No comments   

Issue

I am using Yii & mongodb(YiiMongoDbSuite extension), and created a console application. But its not working giving the error,

include(Mongo.php): failed to open stream: No such file or directory in file /var/www/yii/framework/YiiBase.php at line 418

I have configure the console.php to include all the modules, components and models. But still giving the error.


Solution

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.



Answered By - user133408
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing