Skip to content

Can't mix unix socket & tcp for connection #301

Closed
@Ange7

Description

@Ange7

i can read in PHP doc this example : (http://php.net/manual/fr/mongoclient.construct.php : example #2)

<?php

// try unix socket else use localhost 
$m = new MongoClient("mongodb:///tmp/mongodb-27017.sock,localhost:27017");

?>

But with the same code i have this error :

PHP Fatal error: Uncaught exception 'MongoConnectionException' with message 'Failed to connect to: /tmp/mongodb-27017.sock,localhost:27017:0: No such file or directory' in /usr/share/nginx/html/public/_bootStrap.php:111

If i try only with mongodb://localhost:27017 it's work
if i try only with mongodb:///tmp/mongodb-27017.sock it's work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions