Код: Выделить всё
function getBrokerStatus()
{
log_message("info", "Checking if broker is running....");
try {
$amqpConnection = new AMQPConnection();
$amqpConnection->setLogin("guest");
$amqpConnection->setPassword("guest");
$amqpConnection->setVhost("/");
$amqpConnection->connect();
} catch (Exception $e) {
log_message("info", "Exception: " . $e->getMessage());
return false;
}
if (!$amqpConnection->isConnected()) {
log_message("info", "Cannot connect to the broker! It might not be running");
return false;
}
$amqpConnection->disconnect();
return true;
}
Код: Выделить всё
Exception: Socket error: could not connect to host.
Подробнее здесь: https://stackoverflow.com/questions/222 ... n-php-amqp
Мобильная версия