2.8.16. Working with mongodb
Important points:
- MongoDB databases are available as separate service. The mongodb extension can also be used to work with external databases.
- The mongodb extension is available on PHP 5.4 and higher. On versions PHP 5.4 and 5.5, the correct operation of the extension is not guaranteed, since only an outdated extension exists for them — version 1.2.11 is installed for PHP 5.4, version 1.6.0 for PHP 5.5.
- To work with MongoDB you need install library.
Turning on the module
- Openup PHP settings.
- Turnon "mongodb" in the block "Modules" and save your changes.
- Wait 10-15 minutes for the changes to take effect.
Installing the mongodb library
- Connect to hosting via SSH.
- Change to the desired directory:
cd ~/example.com/www/
In the team instead of
example.com/www/
specify the path to the desired directory. - Install the extension using inifile site:
php -c ~/.system/php/www.example.com.ini -f /usr/local/bin/composer require mongodb/mongodb
Instead
www.example.com
indicate the site for which switchedon mongodb module.