Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 18436 программистов и 1738 роботов. Сейчас ищут 1362 программиста ...
Domain Socket Support
Вернуться к: Connecting
MongoDB has built-in support for via Unix Domain Sockets and will open the socket on startup, by default located in /tmp/mongodb-<port>.sock..
To connect to the socket file, specify the path in your MongoDB connection string:
<?php
$m = new MongoClient("mongodb:///tmp/mongo-27017.sock");
?>
If you would like to authenticate against a database (as described above) with a socket file, you must specify a port of 0 so that the connection string parser can detect the end of the socket path. Alternatively, you can use the constructor options.
<?php
$m = new MongoClient("mongodb://username:password@/tmp/mongo-27017.sock:0/foo");
?>
Список изменений
Версия | Описание |
---|---|
1.0.9 | Added support for Unix Domain Sockets. |
Вернуться к: Connecting