Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mongoconnectionexception(3) [php man page]

MONGOCONNECTIONEXCEPTION(3)						 1					       MONGOCONNECTIONEXCEPTION(3)

The MongoConnectionException class

INTRODUCTION
Thrown when the driver fails to connect to the database. There are a number of possible error messages to help you diagnose the connection problem. These are: o No candidate servers found Thrown when the driver cannot establish a connection to MongoDB (fulfilling the ReadPreferences, if specified). o No server name given. This error occurs if you pass in "" as the server name, probably because of an typo with string interpola- tion, e.g., "$servr" instead of "$server". o failed to get host [hostname] or port [portnum] from [server]. This indicated that the server string was malformed. "[hostname]" and "[portnum]" will be as much as the driver could dicipher of it. o Operation in progress Connecting to the database timed out. o Transport endpoint is not connected Generally means that the connection string isn't correct, the driver couldn't even find the database server. o couldn't determine master No server in a replica set connection was identified as the primary. o couldn't get host info for [server] This indicated that DNS could not resolve the server address you gave. This could easily be caused by a typo, for example, "server" instead of "$server". o Invalid Argument This can be caused by attempting to connect to a machine that is up but that the database isn't actually running on. Make sure that you've started the database server before connecting. o Permission denied This means that the socket could not be opened due to permissions issues. On Red Hat variants, this can be caused by a default setting that does not allow Apache to create network connections. You can override this setting by running: $ /usr/sbin/setsebool -P httpd_can_network_connect 1 If the error message is not listed above, it is probably an error from the C socket, and you can search the web for its usual cause. CLASS SYNOPSIS
MongoConnectionException MongoConnectionExceptionextends MongoException PHP Documentation Group MONGOCONNECTIONEXCEPTION(3)

Check Out this Related Man Page

MYSQLND_MS_DUMP_SERVERS(3)						 1						MYSQLND_MS_DUMP_SERVERS(3)

mysqlnd_ms_dump_servers - Returns a list of currently configured servers

SYNOPSIS
array mysqlnd_ms_dump_servers (mixed $connection) DESCRIPTION
Returns a list of currently configured servers. PARAMETERS
o $connection - A MySQL connection handle obtained from any of the connect functions of the mysqli, mysql or PDO_MYSQL extensions. RETURN VALUES
FALSE on error. Otherwise, returns an array with two entries masters and slaves each of which contains an array listing all corresponding servers. The function can be used to check and debug the list of servers currently used by the plugin. It is mostly useful when the list of servers changes at runtime, for example, when using MySQL Fabric. masters and slaves server entries +-----------------+--------------------------------------+---+ | Key | | | | | | | | | Description | | | | | | | | Version | | | | | | +-----------------+--------------------------------------+---+ | | | | |name_from_config | | | | | | | | | Server entry name from config, if | | | | appliciable. NULL if no configura- | | | | tion name is available. | | | | | | | | Since 1.6.0. | | | | | | | | | | | hostname | | | | | | | | | Host name of the server. | | | | | | | | Since 1.6.0. | | | | | | | | | | | user | | | | | | | | | Database user used to authenticate | | | | against the server. | | | | | | | | Since 1.6.0. | | | | | | | | | | | port | | | | | | | | | TCP/IP port of the server. | | | | | | | | Since 1.6.0. | | | | | | | | | | | socket | | | | | | | | | Unix domain socket of the server. | | | | | | | | Since 1.6.0. | | | | | | +-----------------+--------------------------------------+---+ NOTES
Note mysqlnd_ms_dump_servers(3) requires PECL mysqlnd_ms >> 1.6.0. EXAMPLES
Example #1 mysqlnd_ms_dump_servers(3) example { "myapp": { "master": { "master1": { "host":"master1_host", "port":"master1_port", "socket":"master1_socket", "db":"master1_db", "user":"master1_user", "password":"master1_pw" } }, "slave": { "slave_0": { "host":"slave0_host", "port":"slave0_port", "socket":"slave0_socket", "db":"slave0_db", "user":"slave0_user", "password":"slave0_pw" }, "slave_1": { "host":"slave1_host" } } } } <?php $link = mysqli_connect("myapp", "global_user", "global_pass", "global_db", 1234, "global_socket"); var_dump(mysqlnd_ms_dump_servers($link); ?> The above example will output: array(2) { ["masters"]=> array(1) { [0]=> array(5) { ["name_from_config"]=> string(7) "master1" ["hostname"]=> string(12) "master1_host" ["user"]=> string(12) "master1_user" ["port"]=> int(3306) ["socket"]=> string(14) "master1_socket" } } ["slaves"]=> array(2) { [0]=> array(5) { ["name_from_config"]=> string(7) "slave_0" ["hostname"]=> string(11) "slave0_host" ["user"]=> string(11) "slave0_user" ["port"]=> int(3306) ["socket"]=> string(13) "slave0_socket" } [1]=> array(5) { ["name_from_config"]=> string(7) "slave_1" ["hostname"]=> string(11) "slave1_host" ["user"]=> string(12) "gloabal_user" ["port"]=> int(1234) ["socket"]=> string(13) "global_socket" } } } PHP Documentation Group MYSQLND_MS_DUMP_SERVERS(3)
Man Page