Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-553

Suppress PHP warnings during stream init

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.3
    • Affects Version/s: 1.1.2
    • Component/s: None
    • Labels:
      None

      php -n -c. -r '$m = new MongoDB\Driver\Manager("mongodb://something.wrong:27020"); $m->selectServer(new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY));'
      
      Warning: MongoDB\Driver\Manager::selectServer(): php_network_getaddresses: getaddrinfo failed: Name or service not known in Command line code on line 1
      
      Fatal error: Uncaught exception 'MongoDB\Driver\Exception\RuntimeException' with message 'No suitable servers found (`serverselectiontryonce` set): [Failed connecting to 'something.wrong:27020': php_network_getaddresses: getaddrinfo failed: Name or service not known]' in Command line code:1
      Stack trace:
      #0 Command line code(1): MongoDB\Driver\Manager->selectServer(Object(MongoDB\Driver\ReadPreference))
      #1 {main}
        thrown in Command line code on line 1
      

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: