php 如何在ubuntu中安装php amqp

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7831407/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 03:27:11  来源:igfitidea点击:

how to install php amqp in ubuntu

phprabbitmqubuntu-10.04

提问by Chamil Sanjeewa

I am try to install amqp for php (Integrating PHP with RabbitMQ) using this http://code.google.com/p/php-amqp/.

我尝试使用此http://code.google.com/p/php-amqp/为 php(将 PHP 与 RabbitMQ 集成)安装 amqp 。

after run phpize && ./configure --with-amqp && make && sudo make install

运行后 phpize && ./configure --with-amqp && make && sudo make install

it give error like this

它给出这样的错误

Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

找不到 config.m4。确保在模块的顶级源目录中运行“/usr/bin/phpize”

Please help me, my environment is ubuntu

请帮帮我,我的环境是ubuntu

回答by robbrit

You need to download the code for the PHP library from here: http://code.google.com/p/php-amqp/downloads/list

您需要从这里下载 PHP 库的代码:http: //code.google.com/p/php-amqp/downloads/list

Then cdinto that folder and run the command they tell you to run.

然后cd进入该文件夹并运行他们告诉您运行的命令。

UPDATE: That page is actually an old page, they haven't updated it in a long time. You can grab the latest amqp from http://pecl.php.net/get/amqp:

更新:那个页面实际上是一个旧页面,他们已经很长时间没有更新了。您可以从http://pecl.php.net/get/amqp获取最新的 amqp :

wget http://pecl.php.net/get/amqp -O amqp.tar.gz
tar -zxvf amqp.tar.gz
cd amqp-1.0.7    # replace this with the current version
phpize
./configure --with-amqp
make
sudo make install

Then you'll need to add the following line to your php.inifile:

然后,您需要将以下行添加到您的php.ini文件中:

extension=amqp.so

回答by dcestari

You are missing the required libraries and tools to compile a PHP extension.

您缺少编译 PHP 扩展所需的库和工具。

On Debian/Ubuntu you can get them with:

在 Debian/Ubuntu 上,您可以通过以下方式获得它们:

sudo apt-get install php5-dev

回答by famas23

I recently discovered that after installing the package rabbitmq of its official depo, just after install with the extension amqp.so avel the simple command

我最近发现在安装了它官方depo的rabbitmq包后,在安装扩展名amqp.so avel之后,简单的命令

  1. apt install php-amqp
  2. then add under the path of php.ini extension = 'amqp.so'
  1. apt install php-amqp
  2. 然后在php.ini的路径下添加 extension = 'amqp.so'