Any time I try to run example code (https://github.com/rabbitmq/rabbitmq-tutorials/blob/master/php/receive.php)
I've got error:
`C:\php\php.exe C:_projects\instagram-service\send.php
PHP Fatal error: Uncaught ErrorException: stream_socket_client(): unable to connect to tcp://localhost:5672 (No connection could be made because the target machine actively refused it.
Fatal error: Uncaught ErrorException: stream_socket_client(): unable to connect to tcp://localhost:5672 (No connection could be made because the target machine actively refused it.
) in C:_projects\instagram-service\vendor\php-amqplib\php-amqplib\PhpAmqpLib\Wire\IO\StreamIO.php:134
) in C:_projects\instagram-service\vendor\php-amqplib\php-amqplib\PhpAmqpLib\Wire\IO\StreamIO.php:134
Stack trace:
Stack trace:
Process finished with exit code 255`
This happens with any port.
Firewall is turned OFF (I can run Node.js server on this or any another empty port).
This kind of errors occur when RabbitMQ is not running at all on the localhost.
Can you check that RabbitMQ server is running on this machine?
On Windows it should be shown as erl.exe in process list. You can also check result of rabbitmqctl status. The rabbitmqctl script should be in the RabbitMQ install directory under sbin directory.
when checking the status of rabbitmq getting this "
unable to connect to node 'rabbit@s132-148-22-119'"
@jasdeep343 which is another hint at the fact that the node may not be running on localhost (you haven't posted the entire output, so we can't confirm this hypothesis).
I had the same problem: the broker was not running. I solved it by starting the broker:
rabbitmq-server -detached
Source: https://www.rabbitmq.com/man/rabbitmq-server.1.man.html
@realwahl this solved my problem. thanks
Most helpful comment
I had the same problem: the broker was not running. I solved it by starting the broker:
rabbitmq-server -detachedSource: https://www.rabbitmq.com/man/rabbitmq-server.1.man.html