title: "Socket error: could not connect to host" exception in php-amqp
body: <p>I have written a function which checks if rabbitmq is running.</p>
  
  <pre><code>function getBrokerStatus()
  {
      log_message("info", "Checking if broker is running....");
      try {
          $amqpConnection = new AMQPConnection();
          $amqpConnection-&gt;setLogin("guest");
          $amqpConnection-&gt;setPassword("guest");
          $amqpConnection-&gt;setVhost("/");
          $amqpConnection-&gt;connect();
      } catch (Exception $e) {
          log_message("info", "Exception: " . $e-&gt;getMessage());
          return false;
      }
  
      if (!$amqpConnection-&gt;isConnected()) {
          log_message("info", "Cannot connect to the broker! It might not be running");
          return false;
      }
      $amqpConnection-&gt;disconnect();
      return true;
  }
  </code></pre>
  
  <p>My code catches this exception. I see below in logs -  </p>
  
  <pre><code>Exception: Socket error: could not connect to host.
  </code></pre>
  
  <p>But my rabbitmq server is running then why am I getting this exception? I am using <code>v3.1.1</code> of rabbitmq-server.</p>