I'm trying to install the RabbitMQ PECL extension but after running
sudo pecl install amqp
I get the following cryptic error message, which extensive googling hasn't helped resolve.
I have these packages installed:
librabbitmq - RabbitMQ C client itself)
librabbitmq-dev - dev headers etc.
and RabbitMQ running successfully on localhost
Maybe it could be a mismatch in the version of the C client and what the PECL extension expects, anybody else come across this one?
Make output below....
Cheers
running: make
/bin/bash /tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootZNUmac/amqp- 1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main -I/tmp/pear/temp/amqp - I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM - I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/amqp/amqp.c -o amqp.lo
libtool: compile: cc -I. -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear- build-rootZNUmac/amqp-1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main - I/tmp/pear/temp/amqp -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM - I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/amqp/amqp.c -fPIC -DPIC -o .libs/amqp.o
/bin/bash /tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootZNUmac/amqp- 1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main -I/tmp/pear/temp/amqp - I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM - I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/amqp/amqp_exchange.c -o amqp_exchange.lo
libtool: compile: cc -I. -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear- build-rootZNUmac/amqp-1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main - I/tmp/pear/temp/amqp -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM - I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/amqp/amqp_exchange.c -fPIC -DPIC -o .libs/amqp_exchange.o
/bin/bash /tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootZNUmac/amqp- 1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main -I/tmp/pear/temp/amqp - I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM - I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/amqp/amqp_queue.c -o amqp_queue.lo
libtool: compile: cc -I. -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main - I/tmp/pear/temp/amqp -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM - I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/amqp/amqp_queue.c -fPIC -DPIC -o .libs/amqp_queue.o
/tmp/pear/temp/amqp/amqp_queue.c: In function 'read_message_from_channel':
/tmp/pear/temp/amqp/amqp_queue.c:316:11: error: 'AMQP_FIELD_KIND_U64' undeclared (first use in this function)
/tmp/pear/temp/amqp/amqp_queue.c:316:11: note: each undeclared identifier is reported only once for each function it appears in
/tmp/pear/temp/amqp/amqp_queue.c: In function 'zim_amqp_queue_class_nack':
/tmp/pear/temp/amqp/amqp_queue.c:1020:2: error: unknown type name 'amqp_basic_nack_t'
/tmp/pear/temp/amqp/amqp_queue.c:1039:3: error: request for member 'delivery_tag' in something not a structure or union
/tmp/pear/temp/amqp/amqp_queue.c:1040:3: error: request for member 'multiple' in something not a structure or union
/tmp/pear/temp/amqp/amqp_queue.c:1041:3: error: request for member 'requeue' in something not a structure or union
/tmp/pear/temp/amqp/amqp_queue.c:1046:3: error: 'AMQP_BASIC_NACK_METHOD' undeclared (first use in this function)
make: *** [amqp_queue.lo] Error 1
ERROR: `make' failed
I had to install it applying following steps found here:
# Download the rabbitmq-c library # version 0-9-1
git clone git://github.com/alanxz/rabbitmq-c.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
After that, sudo pecl install amqp did the work.
Using Ubuntu 12.10 with PHP 5.4.3.
this is what I did to install it successfully on debian wheezy:
apt-get install pkg-config librabbitmq-dev librabbitmq0
git clone https://github.com/alanxz/rabbitmq-c
cd rabbitmq-c/
autoreconf -i
./configure
make
make install
pecl install amqp
It looks like the PECL extension is newer than the the libraries that you have got installed.
Install RabbitMQ directly from the their website, using their packages and not the ones that have come with your distribution as they seems to be out of date.
The dev lib from repo is broken (as usually....). You have to clone (from GIT or HG) and make the lib, from php.net :
hg clone http://hg.rabbitmq.com/rabbitmq-c/rev/b01825ecc112 rabbitmq-c
cd rabbitmq-c
# Add the codegen requirement. To find the full list, go here: http://hg.rabbitmq.com/rabbitmq-codegen/tags
# and copy the URL for the appropriate broker version.
hg clone http://hg.rabbitmq.com/rabbitmq-codegen/rev/16bbcb711380 codegen
# Configure, compile and install
autoreconf -i && ./configure && make && sudo make install
Then run "pecl install amqp", worked in my ubuntu 12 with Php 5.3
This is what I did to install it successfully on debian wheezy: I had to use version 0.5.2 of rabbitmq-c
git clone https://github.com/alanxz/rabbitmq-c
cd rabbitmq-c
git checkout tags/v0.5.2
git submodule init
git submodule update
autoreconf -i && ./configure && make && make install
pecl install amqp
This is because your rabbitmq is older than the version the php extension requires.
You can install newer version of rabbitmq or lower version of the extension like:
pecl install amqp-1.2.0
But I think using latest versions is better choice.
Installing rabbitmq's AMQP with pecl with PHP7.0
Just follow few these steps, this will install all its dependencies and amqp library. It works for me with bento/ubuntu-16.04 with php7.0
apt-get update
wget http://in.archive.ubuntu.com/ubuntu/ubuntu/pool/universe/libr/librabbitmq/librabbitmq1_0.5.2-2_amd64.deb
dpkg -i librabbitmq1_0.5.2-2_amd64.deb
wget http://in.archive.ubuntu.com/ubuntu/ubuntu/pool/universe/libr/librabbitmq/librabbitmq-dev_0.5.2-2_amd64.deb
dpkg -i librabbitmq-dev_0.5.2-2_amd64.deb
apt-get install php7.0 php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-xml php7.0-dev
pecl install amqp
echo "extension=amqp.so" >> /etc/php/7.0/cli/php.ini
echo "extension=amqp.so" >> /etc/php/7.0/fpm/php.ini
Librabbitmq-dev and its dependencies of different versions it can be downloaded from
http://in.archive.ubuntu.com/ubuntu/ubuntu/pool/universe/libr/librabbitmq/
Related
I have a linux server CentOS Linux release 8.5.2111 .
I'm trying to compile PDO_IBM extension .
I have php 7.4.
I have installed ibm driver package
tar -xvzf ibm_data_server_driver_package_linuxx64_v11.5.tar.gz
mv dsdriver /opt/ibm/
cd /opt/ibm/dsdriver
./installDSDriver
After that
export IBM_DB_HOME=/opt/ibm/dsdriver
pecl install ibm_db2
Everything is good: I can see the new ext with pecl list
After that (PDO_IBM 1.5.0)
pecl download PDO_IBM
cd to PDO dir
phpize --clean
phpize
./configure
make
make install
The first error is
/bin/sh /home/PDO_IBM-1.5.0/libtool --mode=link cc -DPHP_ATOM_INC -I/home/PDO_IBM-1.5.0/include -I/home/PDO_IBM-1.5.0/main -I/home/PDO_IBM-1.5.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/include -DHAVE_CONFIG_H -g -O2 -o pdo_ibm.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/PDO_IBM-1.5.0/modules pdo_ibm.lo ibm_driver.lo ibm_statement.lo -Wl,-rpath, -L -ldb2
libtool: error: require no space between '-L' and '-ldb2'
If i try to edit MakeFile and correct the space
libtool: error: cannot determine absolute directory name of '-ldb2'
Where I'm wrong ?
Find the solution: the compiler expect to found lib X64 file in /opt/ibm/lib64 but from default dsdriver setup create two folder: lib32 for X32 and lib for X64. just create a copy and the compiler works well.
Also i need to add:
./configure --with-pdo-ibm=/opt/ibm/dsdriver
Problem installing mongodb, dockerfile using php:8.0.10-alpine image
running: make
/bin/sh /tmp/pear/temp/pear-build-defaultuserdIJeIa/mongodb-1.10.0/libtool --mode=compile cc -Isrc/libmongoc/src/common/ -I/tmp/pear/temp/mongodb/src/libmongoc/src/common/ -I/tmp/pear/temp/pear-build-defaultuserdIJeIa/mongodb-1.10.0/include -I/tmp/pear/temp/pear-build-defaultuserdIJeIa/mongodb-1.10.0/main -I/tmp/pear/temp/mongodb -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/tmp/pear/temp/mongodb/src/libmongoc/src/common/ -I/tmp/pear/temp/mongodb/src/libmongoc/src/libbson/src/ -I/tmp/pear/temp/mongodb/src/libmongoc/src/libbson/src/jsonsl/ -I/tmp/pear/temp/mongodb/src/libmongoc/src/libmongoc/src/ -I/tmp/pear/temp/mongodb/src/libmongocrypt/src/ -I/tmp/pear/temp/mongodb/src/libmongocrypt/kms-message/src/ -I/tmp/pear/temp/mongodb/src/libmongocrypt-compat/ -I/tmp/pear/temp/mongodb/src/BSON/ -I/tmp/pear/temp/mongodb/src/MongoDB/ -I/tmp/pear/temp/mongodb/src/MongoDB/Exception/ -
I/tmp/pear/temp/mongodb/src/MongoDB/Monitoring/ -I/tmp/pear/temp/mongodb/src/contrib/ -DHAVE_CONFIG_H -g -O2 -DBSON_COMPILATION -DMONGOC_COMPILATION -DKMS_MESSAGE_ENABLE_CRYPTO=1 -DKMS_MESSAGE_ENABLE_CRYPTO_LIBCRYPTO=1 -c /tmp/pear/temp/mongodb/src/libmongoc/src/common/common-b64.c -o src/libmongoc/src/common/common-b64.lo
make: /bin/sh: Operation not permitted
make: *** [Makefile:277: src/libmongoc/src/common/common-b64.lo] Error 127
Dockerfile
FROM php:8.0.10-alpine && \
pecl install mongodb \
pecl clear-cache \
&& \
echo "extension=mongodb.so" >> /usr/local/etc/php/conf.d/mongodb.ini; \
I tried to install the gnupg yet I seem to keep getting the same error. I am using my MAC to install gnup so encode a file. I'm using PECL to install
pecl install gnupg
Yet I get the following error:
/bin/sh /op/gnupg-1.4.0/libtool --mode=compile cc -I. -I/opt/gnupg-1.4.0 -DPHP_ATOM_INC -I/opt/gnupg-1.4.0/include -I/opt/gnupg-1.4.0/main -I/opt/gnupg-1.4.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/gnupg-1.4.0/gnupg.c -o gnupg.lo
mkdir .libs
cc -I. -I/
opt/gnupg-1.4.0 -DPHP_ATOM_INC -I/opt/gnupg-1.4.0/include -I/opt/gnupg-1.4.0/main -I/opt/gnupg-1.4.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/gnupg-1.4.0/gnupg.c -fno-common -DPIC -o .libs/gnupg.o
/opt/gnupg-1.4.0/gnupg.c:21:10: fatal error: 'php.h' file not found
#include "php.h"
^~~~~~~
I have installed the previous packages using the commands:
brew install gpg
brew install gpgme
I have even tried to download and manually make the extension but I still get the same error.
I had used the instructions from this question.
Does anyone have any ideas about what the issue is?
I am attempting to install OAuth on Ubuntu Server 12.04 but getting errors. I am following this tutorial but something isn't lining up:
http://sergiopvilar.wordpress.com/2013/05/18/how-to-install-php-oauth-extension/
Command I am running in terminal:
sudo pecl install oauth
Last portion of error I am getting response (because it returns several pages of response):
running: make
/bin/bash /tmp/pear/temp/pear-build-rootFgGDRe/oauth-1.2.3/libtool --mode=compile cc -I. -I/tmp/pear/temp/oauth -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootFgGDRe/oauth-1.2.3/include -I/tmp/pear/temp/pear-build-rootFgGDRe/oauth-1.2.3/main -I/tmp/pear/temp/oauth -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -g -c /tmp/pear/temp/oauth/oauth.c -o oauth.lo
libtool: compile: cc -I. -I/tmp/pear/temp/oauth -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootFgGDRe/oauth-1.2.3/include -I/tmp/pear/temp/pear-build-rootFgGDRe/oauth-1.2.3/main -I/tmp/pear/temp/oauth -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -g -c /tmp/pear/temp/oauth/oauth.c -fPIC -DPIC -o .libs/oauth.o
In file included from /tmp/pear/temp/oauth/php_oauth.h:47:0,
from /tmp/pear/temp/oauth/oauth.c:14:
/usr/include/php5/ext/pcre/php_pcre.h:29:18: fatal error: pcre.h: No such file or directory
compilation terminated.
make: *** [oauth.lo] Error 1
ERROR: `make' failed
Make is installed and working. Any advice?
Found it, I needed to install PCRE Library ( Perl 5 Compatible Regular Expression Library ).
# apt-get update
# apt-get install libpcre3 libpcre3-dev
This worked for me.
Try This
apt-get update
apt-get install libpcre3 libpcre3-dev
sudo pecl install mongodb
I got some serious error while installing expect extension in PHP.
I ran sudo pecl install channel://pecl.php.net/expect-0.3.1
I got error like this while running make,
running: make
/bin/bash /tmp/pear/temp/pear-build-rootvXp7LZ/expect-0.3.1/libtool --mode=compile cc -I. -I/tmp/pear/temp/expect -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootvXp7LZ/expect-0.3.1/include -I/tmp/pear/temp/pear-build-rootvXp7LZ/expect-0.3.1/main -I/tmp/pear/temp/expect -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/expect/expect.c -o expect.lo
libtool: compile: cc -I. -I/tmp/pear/temp/expect -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootvXp7LZ/expect-0.3.1/include -I/tmp/pear/temp/pear-build-rootvXp7LZ/expect-0.3.1/main -I/tmp/pear/temp/expect -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/expect/expect.c -fPIC -DPIC -o .libs/expect.o
In file included from /tmp/pear/temp/expect/expect.c:21:0:
/tmp/pear/temp/expect/php_expect.h:33:17: fatal error: tcl.h: No such file or directory
compilation terminated.
make: *** [expect.lo] Error 1
ERROR: `make' failed
Please advice me as I am a very beginner in PHP.
Thanks.
I found this post helpful for this issue. On CentOS I was able to get this installed via:
yum install tcl tcl-devel tk tk-devel
yum install expect expect-devel
pecl install channel://pecl.php.net/expect-0.3.1
Then add the following to php.ini:
extension = expect.so