{"record":{"id":"bc7025e6eb5f950c","repo":"phacility/phabricator","slug":"unable-to-connect-to-ldap-server-s-d","errorCode":null,"errorMessage":"Unable to connect to LDAP server (%s:%d).","messagePattern":"Unable to connect to LDAP server \\((.+?):(.+?)\\)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/auth/adapter/PhutilLDAPAuthAdapter.php","lineNumber":317,"sourceCode":"      $profiler = PhutilServiceProfiler::getInstance();\n      $call_id = $profiler->beginServiceCall(\n        array(\n          'type' => 'ldap',\n          'call' => 'connect',\n          'host' => $host,\n          'port' => $this->port,\n        ));\n\n      $conn = @ldap_connect($host, $this->port);\n\n      $profiler->endServiceCall(\n        $call_id,\n        array(\n          'ok' => (bool)$conn,\n        ));\n\n      if (!$conn) {\n        throw new Exception(\n          pht('Unable to connect to LDAP server (%s:%d).', $host, $port));\n      }\n\n      $options = array(\n        LDAP_OPT_PROTOCOL_VERSION => (int)$this->ldapVersion,\n        LDAP_OPT_REFERRALS        => (int)$this->ldapReferrals,\n      );\n\n      foreach ($options as $name => $value) {\n        $ok = @ldap_set_option($conn, $name, $value);\n        if (!$ok) {\n          $this->raiseConnectionException(\n            $conn,\n            pht(\n              \"Unable to set LDAP option '%s' to value '%s'!\",\n              $name,\n              $value));\n        }","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/adapter/PhutilLDAPAuthAdapter.php#L299-L335","documentation":"Error \"Unable to connect to LDAP server (%s:%d).\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/auth/adapter/PhutilLDAPAuthAdapter.php:317 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}