K
K
Konstantin2016-07-27 22:17:42
PHP
Konstantin, 2016-07-27 22:17:42

php how to work with mongodb?

In general, everything is already behind, mongodb is installed
The module for php is installed here phpini prntscr.com/byaveu
But if I write in php for example
// connect
$m = new MongoDB(); // or Mongo() or MongoClient
All classes - fatal error class Mongo not found ...
But everything indicates that the module is working!
How to use mongo in php?!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Philipp, 2016-07-27
@armenka29

If there is no composer, install getjump.me/ru-php-the-right-way/#composer_%D0%B8_p...
After that, read the tutorial php.net/manual/ru/mongodb.tutorial.library.php
Everything is simple there , put the wrapper and connect it. https://robomongo.org/ will help you with debugging.

R
Rikcon, 2016-07-27
@Rikcon

phpinfo() show us, and we will understand if the module is loaded exactly.

O
OnYourLips, 2016-07-27
@OnYourLips

There is also documentation, and it contains complete instructions:
mongodb.github.io/mongo-php-library/getting-started
1. Install the PHP extension
2. Install composer
3. Install mongodb/mongodb via composer ( https://github. com/mongodb/mongo-php-library)
Library documentation: mongodb.github.io/mongo-php-library

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question