Installing/Configuring
PHP Manual

Runtime Configuration

The behaviour of these functions is affected by settings in php.ini.

Mongo Configure Options
Name Default Changeable Changelog
mongo.default_host NULL PHP_INI_ALL
mongo.default_port NULL PHP_INI_ALL
mongo.auto_reconnect NULL PHP_INI_ALL

For further details and definitions of the PHP_INI_* modes, see the Where a configuration setting may be set.

Here's a short explanation of the configuration directives.

mongo.default_host string

Default hostname. "localhost" is recommended.

mongo.default_port string

The default TCP port number to use when connecting to the database server if no other port is specified. The database's default is 27017.

mongo.auto_reconnect bool

Whether to reconnect to the database if the connection is lost.


Installing/Configuring
PHP Manual