Skip to content

Latest commit

 

History

History
 
 

php

PHP code for RabbitMQ tutorial

Here you can find a PHP code examples from RabbitMQ tutorials.

Requirements

To run the examples you need a running RabbitMQ server.

Additionally you need PHP 5.3 and php-amqplib. To get these dependencies on Ubuntu type:

sudo apt-get install git-core php5-cli
git clone http://github.com/videlalvaro/php-amqplib.git lib/php-amqplib

Since the tutorials are tested with php-amqplib v1.0 you might want to checkout the v1.0 tag as well:

cd lib/php-amqplib/
git checkout v1.0

Code

Tutorial one: "Hello World!":

php send.php
php receive.php

Tutorial two: Work Queues:

php new_task.php
php worker.php

Tutorial three: Publish/Subscribe

php receive_logs.php
php emit_log.php

Tutorial six: RPC:

php rpc_server.php
php rpc_client.php