Exception ' yii\base\errorexception ' with message ' Class ' mongoclient ' not found '

Source: Internet
Author: User
Tags mongoclient

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 '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.