Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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/.

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

like image 482
Chamil Sanjeewa Avatar asked Oct 20 '11 05:10

Chamil Sanjeewa


4 Answers

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
like image 160
robbrit Avatar answered Nov 10 '22 10:11

robbrit


Let's make life easier, follow these 2 steps, and that's all:

  1. apt install php7.4-amqp (it depends on your php version)
  2. Then add under the path of php.ini the following line extension = 'amqp.so'
like image 14
famas23 Avatar answered Nov 10 '22 10:11

famas23


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
like image 3
dcestari Avatar answered Nov 10 '22 10:11

dcestari


You cannot use the "Symfony\Component\Messenger\Bridge\Amqp\Transport\Connection" as the "amqp" extension is not installed.

 sudo apt install php-amqp -y
like image 1
benderalex5 Avatar answered Nov 10 '22 10:11

benderalex5