1.从github上面获取AMQP基于php的实现扩展
2.创建生产者 send.php

1 require(__DIR__ . ‘/../protected/vendor/autoload.php‘); 2 3 use PhpAmqpLib\Connection\AMQPStreamConnection; 4 use PhpAmqpLib\Message\AMQPMessage; 5 6 7 $connection = new AMQPStreamConnection(‘192.168.38.129‘, 5672, ‘fanwq‘, ‘ysq‘); 8 $channel = $connection->channel(); 9