I am trying to connect with options parameter but it does not connect
try
{
$connection_url = "mongodb://{$dbuser}:{$dbpass}@{$dburl}:{$dbport}/{$dbname}";
$m = new MongoClient($connection_url,
array('connectTimeoutMS'=>30000,
'socketTimeoutMS'=>30000)
);
}
catch ( MongoConnectionException $e )
{
echo $e->getMessage();
}
catch ( MongoException $e )
{
echo $e->getMessage();
}
catch ( Exception $e )
{
echo $e->getMessage();
}
this code simply goes to exception with no message.
If I remove options parameters it makes a connection to mongodb server.
Why it does not connect with parameter option?
If I use another way to pass options
parameter
$connection_url = "mongodb://{$dbuser}:{$dbpass}@{$dburl}:{$dbport}
/{$dbname}?connectTimeoutMS=30000&socketTimeoutMS=30000";
$m = new MongoClient($connection_url);
It through error
'MongoConnectionException' with message '- Found unknown connection string option 'connectTimeoutMS' with value '>30000''
Neither way is working with options parameter.
Mongodb is on mongohq.com