简体   繁体   English

如何在ubuntu中安装php amqp

[英]how to install php amqp in ubuntu

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.找不到 config.m4。 Make sure that you run '/usr/bin/phpize' in the top level source directory of the module确保在模块的顶级源目录中运行“/usr/bin/phpize”

Please help me, my environment is ubuntu请帮帮我,我的环境是ubuntu

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 cd into 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.ini file:然后您需要将以下行添加到您的php.ini文件中:

extension=amqp.so

Let's make life easier, follow these 2 steps, and that's all:让我们让生活更轻松,遵循以下 2 个步骤,仅此而已:

  1. apt install php7.4-amqp (it depends on your php version) apt install php7.4-amqp (这取决于你的php版本)
  2. Then add under the path of php.ini the following line extension = 'amqp.so'然后在 php.ini 的路径下添加以下 line extension = 'amqp.so'

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

您不能使用“Symfony\\Component\\Messenger\\Bridge\\Amqp\\Transport\\Connection”,因为未安装“amqp”扩展。

 sudo apt install php-amqp -y

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM