0

I am trying to install Rabbit MQ and the php library AMQP on Ubuntu 14.04, but am receiving an error upon apache start (in apache error log)

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/amqp.so' - /usr/lib/php5/20121212/amqp.so: undefined symbol: amqp_error_string2 in Unknown on line 0

And AMQP does not start.

I followed this: https://github.com/pdezwart/php-amqp/issues/87

And...

locate librabbitmq.so

returns:

/usr/lib/librabbitmq.so.0
/usr/lib/librabbitmq.so.0.0.0

ls -al librabb* returns:

/usr/lib/librabbitmq.so.0 -> librabbitmq.so.0.0.0  (root / root)
librabbitmq.so.0.0.0 (root / root)

In /user/local/lib there is also:

librabbitmq.so -> /usr/lib/librabbitmq.so.0 (root / root)

Permissions are root/root and 755 on all.

Any help, most appreciated.

Thanks

rjbathgate
  • 75
  • 2
  • 11
  • It is hard to guess what problem exactly do you have while you didn't provide any software versions. To give the first aid, just check that you have the latest librabbitmq library - since php-amqp>=1.3.0 rabbitmqp should be >= 0.4.1. – pinepain Jun 26 '14 at 09:49
  • Thanks for the reply. 'rabbitmqctl status' returns RabbitMQ version 3.2.4. Let me know if you need anything else? – rjbathgate Jun 26 '14 at 23:20

1 Answers1

3

Installing amqp via pecl didn't worked for me so i had to compile the RabbitMQ C AMQP client library and pecl amqp myself.

RabbitMQ C AMQP Client library can be found at https://github.com/alanxz/rabbitmq-c/ and Pecl amqp from http://pecl.php.net/package/amqp .

Here is a list of commands that should do the trick on ubuntu 14.04:

#create a directory for sources
mkdir ~/kit
cd ~/kit

#download and install the rabbitmq c amqp lib
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.5.1/rabbitmq-c-0.5.1.tar.gz
tar -zxvf rabbitmq-c-0.5.1.tar.gz
cd rabbitmq-c-0.5.1/
./configure
make
sudo make install

cd ..

#download and compile the amqp
wget http://pecl.php.net/get/amqp-1.4.0.tgz
tar -zxvf amqp-1.4.0.tgz
cd amqp-1.4.0/
phpize && ./configure --with-amqp && make && sudo make install

#Add amqp extension to php mods-availabile directory
echo "extension=amqp.so" > /etc/php5/mods-available/amqp.ini

#Enabled it in cli
cd /etc/php5/cli/conf.d/
ln -s ../../mods-available/amqp.ini 20-amqp.ini
php -m | grep amqp

#Enabled it in cli
cd /etc/php5/apache2/conf.d/
ln -s ../../mods-available/amqp.ini 20-amqp.ini


#restart Apache and than check phpinfo on web
service apache2 restart