-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.9.0
-
Component/s: None
-
None
Take the following connection string:
mongodb+srv://xxx.yyy.mongodb.net:27017
This string works when used for connection from the command line:
mongo 'mongodb+srv://catdev.jdx66.mongodb.net:27017'
But when the same string is used to connect with the PHP driver, that fails:
<?php require_once __DIR__ . '/vendor/autoload.php'; new \MongoDB\Client('mongodb+srv://xxx.yyy.mongodb.net:27017'); -- PHP Fatal error: Uncaught MongoDB\Driver\Exception\InvalidArgumentException: Failed to parse MongoDB URI: 'mongodb+srv://xxx.yyy.mongodb.net:27017'. Invalid service name in URI. in /vendor/mongodb/mongodb/src/Client.php:116
I believe that connection string is correct as per the specification. I know 27017 is the default port but in general it may be different.
- related to
-
SERVER-53770 mongo shell should prohibit port numbers in mongodb+srv connection strings
- Closed
-
CDRIVER-4437 URI validation should inform users that SRV URIs should not contain port numbers
- Closed
- mentioned in
-
Page Loading...