How to install and use PHP ActiveMQ

Time:2021-6-11

This article describes the installation and use of PHP ActiveMQ. The details are as follows:

1、 What is ActiveMQ?

ActiveMQ is the most popular and powerful open source message bus produced by Apache. Support multi language clients (Java, C, C + +, C #, python, ruby, Perl, PHP),

Support a variety of protocols (openwire, stomp, rest, WS notification, XMPP, AMQP).

2、 Install JDK


http://www.oracle.com/technetwork/java/javase/downloads/index.html

For example: jdk-8u121-linux-x64.tar.gz

Put JDK under / data / jdk8 (the path can be customized at will)


> tar xf jdk-8u121-linux-x64.tar.gz
> mv jdk1.8.0_121 /data/jdk8
> vi /etc/profile

export JAVA_HOME=/data/jdk8
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib
export PATH=$JAVA_HOME/bin:$PATH

> source /etc/profile
> java -version

3、 Installing ActiveMQ


http://activemq.apache.org/activemq-5144-release.html

For example: apache-activemq-5.14.4-bin.tar.gz


> tar xf apache-activemq-5.14.4-bin.tar.gz
> mv apache-activemq-5.14.4 /data/activemq5

Start ActiveMQ in background mode


> /data/activemq5/bin/activemq start

ActiveMQ comes with a web server (jetty)

In conf / jetty. XML is the configuration file

My virtual machine IP is 192.168.1.222

We passed http://192.168.1.222 : 8161 / admin to access, pay attention to the firewall open this port or directly turn off the firewall.

The user name / password is admin / Admin by default

For more information about PHP, readers interested in it can see the following topics: PHP extension development tutorial, PHP network programming skills summary, PHP curl usage summary, PHP array operation skills encyclopedia, PHP data structure and algorithm tutorial, PHP programming algorithm summary and PHP string Usage Summary

I hope this article is helpful for PHP programming.