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.
php mongodb laravel-5.2
add a comment |
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.
php mongodb laravel-5.2
How did you actually create your project? You should have done alarvel 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
add a comment |
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.
php mongodb laravel-5.2
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
php mongodb laravel-5.2
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 alarvel 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
add a comment |
How did you actually create your project? You should have done alarvel 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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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