The behaviour of these functions is affected by settings in php.ini.
Name | Default | Changeable |
---|---|---|
mongo.default_host | "localhost" | PHP_INI_ALL |
mongo.default_port | 27017 | PHP_INI_ALL |
mongo.auto_reconnect | true | PHP_INI_SYSTEM |
mongo.allow_persistent | true | PHP_INI_SYSTEM |
mongo.chunk_size | 262144 | PHP_INI_SYSTEM |
mongo.cmd | "$" | PHP_INI_ALL |
mongo.utf8 | "1" | PHP_INI_ALL |
Here's a short explanation of the configuration directives.
Default hostname when nothing is passed to the constructor.
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.
Whether to reconnect to the database if the connection is lost.
If persistent connections are allowed.
The number of bytes-per-chunk. Used in divvying up GridFS files. This number must be at least 100 less than 4 megabytes (max: 4194204) and it is recommended that it be less than that.
A character to be used in place of $ in modifiers and comparisons.
If an exception should be thrown for non-UTF8 strings. Until version 1.0.4, the PHP driver would ignore non-UTF8 strings, even though you're not supposed to insert them. As of 1.0.4, the driver throws a MongoException. To ease the transition for applications that insert non-UTF8 strings, you can turn this option off to emulate the old, non-exception-throwning behavior. This option will be eliminated and exceptions always thrown for non-UTF8 strings starting with version 1.1.0.