How do I install the GnuPG PHP extension?

General Tech Bugs & Fixes 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I'm having trouble installing a PHP native extension: GnuPG. Here's what I've tried so far.

First:

sudo port install gpgme
sudo pecl install gnupg

Output from the second command ends like so:

checking for gnupg support... yes, shared
checking for gnupg files in default path... not found
configure: error: Please reinstall the gpgme distribution
ERROR: `/private/tmp/pear/temp/gnupg/configure' failed

So, I tried installing manually, guessing at some values based on output of port contents gpgme and port contents gnupg...

pecl download gnupg
phpize
./configure --with-gnupg=/opt/local/include --with-libdir=/opt/local/lib

Alas, no luck. This ends like so:

checking for gnupg support... yes, shared
checking for gpgme_check_version in -lgpgme... no
configure: error: wrong gpgme lib version or lib not found

I then tried augmenting CFLAGS like so:

CFLAGS="-L/opt/local/lib" ./configure --with-gnupg=/opt/local/include

This returns a nonzero exit code, but then make fails. Here's the end of that output:

/bin/sh /tmp/gnupg-1.3.2/libtool --mode=link cc -DPHP_ATOM_INC -I/tmp/gnupg-1.3.2/include -I/tmp/gnupg-1.3.2/main -I/tmp/gnupg-1.3.2 -I/Applications/MAMP/bin/php/php5.3.6/include/php -I/Applications/MAMP/bin/php/php5.3.6/include/php/main -I/Applications/MAMP/bin/php/php5.3.6/include/php/TSRM -I/Applications/MAMP/bin/php/php5.3.6/include/php/Zend -I/Applications/MAMP/bin/php/php5.3.6/include/php/ext -I/Applications/MAMP/bin/php/php5.3.6/include/php/ext/date/lib -I/opt/local/include  -DHAVE_CONFIG_H  -L/opt/local/lib   -o gnupg.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/gnupg-1.3.2/modules  gnupg.lo gnupg_keylistiterator.lo -Wl,-rpath,/opt/local/include/lib -L/opt/local/include/lib -lgpgme
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/gnupg.so -bundle  .libs/gnupg.o .libs/gnupg_keylistiterator.o  -L/opt/local/lib -L/opt/local/include/lib /opt/local/lib/libgpgme.dylib /opt/local/lib/libassuan.dylib /opt/local/lib/libgpg-error.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib  -Wl,-rpath -Wl,/opt/local/include/lib
ld: warning: directory not found for option '-L/opt/local/include/lib'
ld: duplicate symbol _gnupg_keylistiterator_class_entry in .libs/gnupg_keylistiterator.o and .libs/gnupg.o for architecture x86_64
collect2: ld returned 1 exit status
make: *** [gnupg.la] Error 1

I'm suspicious that my --with-gnupg arg somehow messed up linking, because I see -L/opt/local/include/lib in the output of that failed make run.

That's where I'm stuck. Feels like I'm trying way too hard or just going down the wrong path.

I'm using Snow Leopard (v10.6.8). The PHP command-line program I'm using came with MAMP2.1.0.

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community