I'm using PHP 8.1 with the php-amqplib "^3.5".
I added the code below to try the connection:
try {
$connection = new AMQPStreamConnection(....);
} catch (Exception $e) {
echo $e->getMessage();
return FALSE;
}
And the following error message is always shown, even with just one connection attempt: Too many read attempts detected in StreamIO
I even tried to telnet from the server with error to the RabbitMQ server and it returns that the connection seems to be OK.
telnet 192.168.50.1 5672
Trying 192.168.50.1...
Connected to 192.168.50.1.
Escape character is '^]'.
My RabbitMQ log:
2023-05-12 17:02:01.493761-03:00 [info] <0.7606.4> accepting AMQP connection <0.7606.4> (192.168.50.2:57988 -> 192.168.50.1:5672)
2023-05-12 17:02:04.501676-03:00 [warning] <0.7606.4> closing AMQP connection <0.7606.4> (192.168.50.2:57988 -> 192.168.50.1:5672):
2023-05-12 17:02:04.501676-03:00 [warning] <0.7606.4> client unexpectedly closed TCP connection
What could possibly be happening?
SOLVED
The problem occurred because the ext-sockets and mbstring extensions, which are mandatory for the library, were not installed.