Problem Description:
Originally the project runs well, moved an office (computer mainframe together), the next day when the login is not.
PHP version and extension did not change, and did not modify any configuration, I try to restart the PHP5-FPM service, restart the Nginx service, and then log in or the same old.
The error is as follows:
Exception ' Yii\base\errorexception ' with message ' Class ' mongoclient ' not found ' in/home/user/yiiproject/src/vendor/yiisoft/ yii2-mongodb/connection.php:247Stack Trace:#0 [internal function]: yii\base\errorhandler- >handlefatalerror ()#1 {main}
Workaround:
sudo VI
Inside the Mongo.ini Check extension = mongo.so is commented out, I was commented out, so can not load the MONGO extension, let go. And then restart the PHP service is OK.
This method does not necessarily apply to other situations.
If the extension is not commented or is an error, you can try the following ideas:
Solution Ideas:
To view the extensions that PHP has installed:
Php5-m //Check the PHP extension to see if there is a MONGO module. If not, you need to install the MONGO extension
grep ' Configuration File ' //Find PHP configuration file
=/etc/php5/=/etc/php5/cli/php.ini
sudo VI /etc/php5/cli/php.ini //Open PHP config file and check for extension=mongo.so
When the PHP configuration file is modified, it will be effective to restart the PHP service.
Sudo
Exception ' yii\base\errorexception ' with message ' Class ' mongoclient ' not found '