how to install php amqp in ubuntu

萝らか妹 提交于 2019-12-09 15:28:22

问题


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

after run 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

Please help me, my environment is ubuntu


回答1:


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

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

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:

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:

extension=amqp.so



回答2:


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

On Debian/Ubuntu you can get them with:

sudo apt-get install php5-dev



回答3:


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

  1. apt install php-amqp
  2. Add thereafter under the path of php.ini extension = 'amqp.so'


来源:https://stackoverflow.com/questions/7831407/how-to-install-php-amqp-in-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!