FatalThrowableError in Connection.php line 149: Class 'MongoClient' not found











up vote
0
down vote

favorite












I'm using laravel 5.2 with mongodb.
firstly I have created the laravel project using the command



composer create-project --prefer-dist laravel/laravel NC_Data



Then I have install the latest version of the mongodb package using the composer like:



composer require jenssegers/mongodb



Added the below line in config/app.php, in providers array:



JenssegersMongodbMongodbServiceProvider::class



and in the aliases array:



'Moloquent' => 'JenssegersMongodbModel'



below is the connections array in app/config/database.php, :



'mongodb' => array(
'driver' => 'mongodb',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE', 'dbname'),
'username' => env('DB_USERNAME', 'username'),
'password' => env('DB_PASSWORD', 'password'),
'options' => array(
'db' => 'admin' // sets the authentication database required by
mongo 3)
),


Also changed the default DB_Connection:



'default' => env('DB_CONNECTION', 'mongodb'),



When I run my project using CLI command of laravel i.e php artisan serve.It will run on port 8000 i.e http://localhost:8000/listing it works perfectly.But When try to run it using http://localhost/NC_Data/listing. NC_Data is my project folder,it gives me the below error:



FatalThrowableError in Connection.php line 149:
Class 'MongoClient' not found.



Can anybody please help me with this. Thanks in advance.










share|improve this question
























  • How did you actually create your project? You should have done a larvel new and various other stages. These things covered in various existing tutorials make sure you install all required dependencies. The message indicates you are missing something, so if you are asking a question then you should list all your steps to create your project you have taken so far.
    – Neil Lunn
    Nov 14 at 7:41










  • I have followed the steps which are there in the laravel doc for creating new project, here is the link: laravel.com/docs/5.2/installation
    – pallavi
    Nov 14 at 8:38












  • So a "question" posted here requires you to actually "show what you did within your question". Saying things like "I did all the steps" does not show people what you actually did. Writing all the steps within your question does.
    – Neil Lunn
    Nov 14 at 8:40










  • Thank you. I have edited my question with the steps that I have followed
    – pallavi
    Nov 14 at 9:20















up vote
0
down vote

favorite












I'm using laravel 5.2 with mongodb.
firstly I have created the laravel project using the command



composer create-project --prefer-dist laravel/laravel NC_Data



Then I have install the latest version of the mongodb package using the composer like:



composer require jenssegers/mongodb



Added the below line in config/app.php, in providers array:



JenssegersMongodbMongodbServiceProvider::class



and in the aliases array:



'Moloquent' => 'JenssegersMongodbModel'



below is the connections array in app/config/database.php, :



'mongodb' => array(
'driver' => 'mongodb',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE', 'dbname'),
'username' => env('DB_USERNAME', 'username'),
'password' => env('DB_PASSWORD', 'password'),
'options' => array(
'db' => 'admin' // sets the authentication database required by
mongo 3)
),


Also changed the default DB_Connection:



'default' => env('DB_CONNECTION', 'mongodb'),



When I run my project using CLI command of laravel i.e php artisan serve.It will run on port 8000 i.e http://localhost:8000/listing it works perfectly.But When try to run it using http://localhost/NC_Data/listing. NC_Data is my project folder,it gives me the below error:



FatalThrowableError in Connection.php line 149:
Class 'MongoClient' not found.



Can anybody please help me with this. Thanks in advance.










share|improve this question
























  • How did you actually create your project? You should have done a larvel new and various other stages. These things covered in various existing tutorials make sure you install all required dependencies. The message indicates you are missing something, so if you are asking a question then you should list all your steps to create your project you have taken so far.
    – Neil Lunn
    Nov 14 at 7:41










  • I have followed the steps which are there in the laravel doc for creating new project, here is the link: laravel.com/docs/5.2/installation
    – pallavi
    Nov 14 at 8:38












  • So a "question" posted here requires you to actually "show what you did within your question". Saying things like "I did all the steps" does not show people what you actually did. Writing all the steps within your question does.
    – Neil Lunn
    Nov 14 at 8:40










  • Thank you. I have edited my question with the steps that I have followed
    – pallavi
    Nov 14 at 9:20













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm using laravel 5.2 with mongodb.
firstly I have created the laravel project using the command



composer create-project --prefer-dist laravel/laravel NC_Data



Then I have install the latest version of the mongodb package using the composer like:



composer require jenssegers/mongodb



Added the below line in config/app.php, in providers array:



JenssegersMongodbMongodbServiceProvider::class



and in the aliases array:



'Moloquent' => 'JenssegersMongodbModel'



below is the connections array in app/config/database.php, :



'mongodb' => array(
'driver' => 'mongodb',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE', 'dbname'),
'username' => env('DB_USERNAME', 'username'),
'password' => env('DB_PASSWORD', 'password'),
'options' => array(
'db' => 'admin' // sets the authentication database required by
mongo 3)
),


Also changed the default DB_Connection:



'default' => env('DB_CONNECTION', 'mongodb'),



When I run my project using CLI command of laravel i.e php artisan serve.It will run on port 8000 i.e http://localhost:8000/listing it works perfectly.But When try to run it using http://localhost/NC_Data/listing. NC_Data is my project folder,it gives me the below error:



FatalThrowableError in Connection.php line 149:
Class 'MongoClient' not found.



Can anybody please help me with this. Thanks in advance.










share|improve this question















I'm using laravel 5.2 with mongodb.
firstly I have created the laravel project using the command



composer create-project --prefer-dist laravel/laravel NC_Data



Then I have install the latest version of the mongodb package using the composer like:



composer require jenssegers/mongodb



Added the below line in config/app.php, in providers array:



JenssegersMongodbMongodbServiceProvider::class



and in the aliases array:



'Moloquent' => 'JenssegersMongodbModel'



below is the connections array in app/config/database.php, :



'mongodb' => array(
'driver' => 'mongodb',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE', 'dbname'),
'username' => env('DB_USERNAME', 'username'),
'password' => env('DB_PASSWORD', 'password'),
'options' => array(
'db' => 'admin' // sets the authentication database required by
mongo 3)
),


Also changed the default DB_Connection:



'default' => env('DB_CONNECTION', 'mongodb'),



When I run my project using CLI command of laravel i.e php artisan serve.It will run on port 8000 i.e http://localhost:8000/listing it works perfectly.But When try to run it using http://localhost/NC_Data/listing. NC_Data is my project folder,it gives me the below error:



FatalThrowableError in Connection.php line 149:
Class 'MongoClient' not found.



Can anybody please help me with this. Thanks in advance.







php mongodb laravel-5.2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 at 9:40









Warren Clarin

1819




1819










asked Nov 14 at 7:33









pallavi

13




13












  • How did you actually create your project? You should have done a larvel new and various other stages. These things covered in various existing tutorials make sure you install all required dependencies. The message indicates you are missing something, so if you are asking a question then you should list all your steps to create your project you have taken so far.
    – Neil Lunn
    Nov 14 at 7:41










  • I have followed the steps which are there in the laravel doc for creating new project, here is the link: laravel.com/docs/5.2/installation
    – pallavi
    Nov 14 at 8:38












  • So a "question" posted here requires you to actually "show what you did within your question". Saying things like "I did all the steps" does not show people what you actually did. Writing all the steps within your question does.
    – Neil Lunn
    Nov 14 at 8:40










  • Thank you. I have edited my question with the steps that I have followed
    – pallavi
    Nov 14 at 9:20


















  • How did you actually create your project? You should have done a larvel new and various other stages. These things covered in various existing tutorials make sure you install all required dependencies. The message indicates you are missing something, so if you are asking a question then you should list all your steps to create your project you have taken so far.
    – Neil Lunn
    Nov 14 at 7:41










  • I have followed the steps which are there in the laravel doc for creating new project, here is the link: laravel.com/docs/5.2/installation
    – pallavi
    Nov 14 at 8:38












  • So a "question" posted here requires you to actually "show what you did within your question". Saying things like "I did all the steps" does not show people what you actually did. Writing all the steps within your question does.
    – Neil Lunn
    Nov 14 at 8:40










  • Thank you. I have edited my question with the steps that I have followed
    – pallavi
    Nov 14 at 9:20
















How did you actually create your project? You should have done a larvel new and various other stages. These things covered in various existing tutorials make sure you install all required dependencies. The message indicates you are missing something, so if you are asking a question then you should list all your steps to create your project you have taken so far.
– Neil Lunn
Nov 14 at 7:41




How did you actually create your project? You should have done a larvel new and various other stages. These things covered in various existing tutorials make sure you install all required dependencies. The message indicates you are missing something, so if you are asking a question then you should list all your steps to create your project you have taken so far.
– Neil Lunn
Nov 14 at 7:41












I have followed the steps which are there in the laravel doc for creating new project, here is the link: laravel.com/docs/5.2/installation
– pallavi
Nov 14 at 8:38






I have followed the steps which are there in the laravel doc for creating new project, here is the link: laravel.com/docs/5.2/installation
– pallavi
Nov 14 at 8:38














So a "question" posted here requires you to actually "show what you did within your question". Saying things like "I did all the steps" does not show people what you actually did. Writing all the steps within your question does.
– Neil Lunn
Nov 14 at 8:40




So a "question" posted here requires you to actually "show what you did within your question". Saying things like "I did all the steps" does not show people what you actually did. Writing all the steps within your question does.
– Neil Lunn
Nov 14 at 8:40












Thank you. I have edited my question with the steps that I have followed
– pallavi
Nov 14 at 9:20




Thank you. I have edited my question with the steps that I have followed
– pallavi
Nov 14 at 9:20

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53295116%2ffatalthrowableerror-in-connection-php-line-149-class-mongoclient-not-found%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53295116%2ffatalthrowableerror-in-connection-php-line-149-class-mongoclient-not-found%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?