sudo pecl install amqp on osx :)

Installing amqp on osx isn’t too easy 😉
RabbitMq native drivers for php needs many dependencies (automake, pkg-config… easy to install by brew)
But this error surprise me

/Applications/  all-am
  CC       librabbitmq/librabbitmq_librabbitmq_la-amqp_openssl.lo
In file included from librabbitmq/amqp_openssl.c:32:
./librabbitmq/amqp_openssl_hostname_validation.h:34:10: fatal error: 'openssl/x509v3.h' file not found

I used rabbitmq library from:

 # Download the rabbitmq-c library @ version 0-9-1
 git clone git://
 cd rabbitmq-c
 # Enable and update the codegen git submodule
 git submodule init
 git submodule update
 # Configure, compile and install
 autoreconf -i && ./configure && make && sudo make install


even i had installed openssl by brew still errors appeared

To solve this problem, just run (update the version if u has newer one):

cd ./librabbitmq
sudo ln -s /usr/local/Cellar/openssl/1.0.2g/include/openssl ./openssl
ln -s
lrwxr-xr-x   1 root  wheel     48 Apr  2 12:01 openssl -> /usr/local/Cellar/openssl/1.0.2g/include/openssl
cd .. && autoreconf -i && ./configure && make && sudo make install

now you attached properly openssl dependency under rabbitmq lib.