Linux rabbitmq的安装和安装amqp的php插件
RabbitMQ是一个消息代理。它的核心原理非常简单:接收和发送消息。你可以把它想像成一个邮局:你把信件放入邮箱,邮递员就会把信件投递到你的收件人处。在这个比喻中,RabbitMQ是一个邮箱、邮局、邮递员。RabbitMQ和邮局的主要区别是,它处理的不是纸,而是
RabbitMQ是一个消息代理。它的核心原理非常简单:接收和发送消息。你可以把它想像成一个邮局:你把信件放入邮箱,邮递员就会把信件投递到你的收件人处。在这个比喻中,RabbitMQ是一个邮箱、邮局、邮递员。RabbitMQ和邮局的主要区别是,它处理的不是纸,而是接收、存储和发送二进制的数据——消息。
第一步 安装erlang rabbitmq的依赖
wget http://www.erlang.org/download/otp_src_17.4.tar.gz
tar -zxvf otp_src_17.4.tar.gz
cd otp_src_17.4
./configure --prefix=/data/klj/erlang #我自己指定位置
make
make install
cd /data/klj/erlang/
#set erlang environment
export PATH=$PATH:/data/klj/erlang/bin #修改 ~/.bash_profile
source profile使得文件生效
网上说需要 我自己就下载安装了 simplejson安装 rabbitmq的依赖
wget https://pypi.python.org/packages/source/s/simplejson/simplejson-3.6.5.tar.gz
tar -zxvf simplejson-3.6.5.tar.gz
cd simplejson-3.6.5
python setup.py install
第二步 获取rabbitmq3.4.2版本 最近稳定版
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.4.2/rabbitmq-server-generic-unix-3.4.2.tar.gz
tar -zxvf rabbitmq-server-generic-unix-3.4.2.tar.gz
cd rabbitmq_server-3.4.2/
cd sbin/
#./rabbitmq-server -detached #网上说后台执行 但在mac上不行
./rabbitmq-server #启动rabbitmq的服务
./rabbitmq-plugins enable rabbitmq_management #进入管理模式web
访问地址:http://127.0.0.1:15672/ guest guest
用户配置: http://www.rabbitmq.com/man/rabbitmqctl.1.man.html#
rabbitmqctl add_user konglj 123456 #设定用户名
rabbitmqctl set_user_tags konglj administrator #设定用户类型
第三步 先安装rabbitmq-c 随后安装amqp扩展
通过浏览器下载rabbitmq-c-0.5.2.tar.gz https://github.com/alanxz/rabbitmq-c/
cd rabbitmq-c-0.5.2
./configure
make && make install
./examples/amqp_listen localhost 5672 amq.direct test
./examples/amqp_sendstring localhost 5672 amq.direct test "hello world"
./examples/amqp_sendstring localhost 5672 amq.direct test "hello world"
./examples/amqp_sendstring 127.0.0.1 5672 amq.direct test "hello world"
紧接上步安装php-amqp的扩张
wget http://pecl.php.net/get/amqp-1.3.0.tgz
tar -zxvf amqp-1.3.0.tgz
cd amqp-1.3.0
/data/klj/php/bin/phpize
./configure --with-php-config=/data/klj/php/bin/php-config --with-amqp
make
make install
错误:Please reinstall the librabbit-mq distribution http://jingyan.baidu.com/article/e4511cf3362b872b845eafb9.html 解决librabbit-mq安装问题
#./configure --with-php-config=/data/klj/php/bin/php-config --with-amqp --with-librabbitmq-dir=/data/source/rabbitmq-c-0.5.2
第四步 使用官网提供的php-amqplib
下载php-amqplib https://github.com/videlalvaro/php-amqplib
通过git没有下载完成,下载压缩包解压
安装文档 修改couposer.json
随后执行 composer.phar install 替换为 /usr/local/bin/composer install #没有composer需要先安装composer
安装composer php-amqplib的依赖环境
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
php-amqplib 环境搭建
整个环境已经搭建完成,可以测试开发了。
参考文章
http://www.rabbitmq.com/features.html rabbitmq官网
https://github.com/videlalvaro/php-amqplib php-amqplib官网
https://getcomposer.org/doc/00-intro.md#installation-nix composer官网
http://www.yuansir-web.com/2013/05/31/rabbitmq%E5%AE%98%E6%96%B9%E4%B8%AD%E6%96%87%E5%85%A5%E9%97%A8%E6%95%99%E7%A8%8Bphp%E7%89%88-%E7%AC%AC%E4%BA%8C%E9%83%A8%E5%88%86%E5%B7%A5%E4%BD%9C%E9%98%9F%E5%88%97%EF%BC%88work-queues%EF%BC%89/ 学习博客
http://jingyan.baidu.com/article/e4511cf3362b872b845eafb9.html 解决librabbit-mq安装问题
http://www.cnblogs.com/astroboyx/archive/2012/04/09/2739902.html RabbitMQ的安装与配置

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The main reasons why you cannot log in to MySQL as root are permission problems, configuration file errors, password inconsistent, socket file problems, or firewall interception. The solution includes: check whether the bind-address parameter in the configuration file is configured correctly. Check whether the root user permissions have been modified or deleted and reset. Verify that the password is accurate, including case and special characters. Check socket file permission settings and paths. Check that the firewall blocks connections to the MySQL server.

There are many reasons why MySQL startup fails, and it can be diagnosed by checking the error log. Common causes include port conflicts (check port occupancy and modify configuration), permission issues (check service running user permissions), configuration file errors (check parameter settings), data directory corruption (restore data or rebuild table space), InnoDB table space issues (check ibdata1 files), plug-in loading failure (check error log). When solving problems, you should analyze them based on the error log, find the root cause of the problem, and develop the habit of backing up data regularly to prevent and solve problems.

MySQL cannot run directly on Android, but it can be implemented indirectly by using the following methods: using the lightweight database SQLite, which is built on the Android system, does not require a separate server, and has a small resource usage, which is very suitable for mobile device applications. Remotely connect to the MySQL server and connect to the MySQL database on the remote server through the network for data reading and writing, but there are disadvantages such as strong network dependencies, security issues and server costs.

The future of PHP will be achieved by adapting to new technology trends and introducing innovative features: 1) Adapting to cloud computing, containerization and microservice architectures, supporting Docker and Kubernetes; 2) introducing JIT compilers and enumeration types to improve performance and data processing efficiency; 3) Continuously optimize performance and promote best practices.

Effective monitoring of MySQL and MariaDB databases is critical to maintaining optimal performance, identifying potential bottlenecks, and ensuring overall system reliability. Prometheus MySQL Exporter is a powerful tool that provides detailed insights into database metrics that are critical for proactive management and troubleshooting.

Unable to access MySQL from the terminal may be due to: MySQL service not running; connection command error; insufficient permissions; firewall blocks connection; MySQL configuration file error.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

Linux is widely used in servers, embedded systems and desktop environments. 1) In the server field, Linux has become an ideal choice for hosting websites, databases and applications due to its stability and security. 2) In embedded systems, Linux is popular for its high customization and efficiency. 3) In the desktop environment, Linux provides a variety of desktop environments to meet the needs of different users.
