Main purpose of this code is present how to produce messages into RabbitMQ via PHP.
- Access to RabbitMQ server
- Composer
- PHP >= 5.4 (only if You want to quick deploy via PHP built-in server)
Clone this, navigate to cloned repo and install required vendors via Composer:
$ composer.phar install
Make sure that RabbitMQ is running on localhost. In other hand You have to change AMQPConnection
constructor params placed in produce.php
file
$connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');
Optionally navigate to root of cloned repo and launch:
$ php -S localhost:8000
If You already have installed web server (like nginx or apache) just configure new vhost pointing to cloned root dir
Navigate to localhost:8000
in Your web browser and start producing messages.