0

End goal: use PHP GnuPG library in my Mediawiki extension

I have installed

  • gpgme with dependencies
  • run pecl install gnupg = no errors
  • added extension=gnupg.so to my php.ini

:

[root@dev-lamp01]# locate gnupg.so
/usr/lib64/php/modules/gnupg.so

[root@dev-lamp01]# file /usr/lib64/php/modules/gnupg.so
/usr/lib64/php/modules/gnupg.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped

[root@dev-lamp01]# locate  libgpgme.so.11
/usr/local/lib/libgpgme.so.11
/usr/local/lib/libgpgme.so.11.8.1

[root@dev-lamp01]# file /usr/local/lib/libgpgme.so.11
/usr/local/lib/libgpgme.so.11: symbolic link to `libgpgme.so.11.8.1'

[root@dev-lamp01]# file /usr/local/lib/libgpgme.so.11.8.1
/usr/local/lib/libgpgme.so.11.8.1: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped

yet:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/gnupg.so' - libgpgme.so.11: cannot open shared object file: No such file or directory in Unknown on line 0

what am i missing? thanks

  • i ran [root@dev-lamp01 modules]# ldd /usr/lib64/php/modules/gnupg.so libgpgme.so.11 => not found libc.so.6 => /lib64/libc.so.6 (0x00002aefb4964000) /lib64/ld-linux-x86-64.so.2 (0x00002aefb452e000) – webwesen Jan 10 '13 at 18:57
  • updating LD_LIBRARY_PATH helped it for the php cli... - will restart httpd tonight to check how it helps for the web side of things... – webwesen Jan 10 '13 at 20:56
3

Solution that fixed the problem in my case:

$ php -r 'var_dump(function_exists("gnupg_decrypt"));';

PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/gnupg.so' - **libgpgme.so.11: cannot open shared object file**: No such file or directory in Unknown on line 0
bool(false)

$ ldd /usr/lib/php5/20100525/gnupg.so
    linux-vdso.so.1 =>  (0x00007fff715ff000)
    **libgpgme.so.11 => not found**
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f087c815000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f087cdea000)

It seems that the server doesn’t load libraries from the /usr/local/lib folder. To fix this problem just add /usr/local/lib to /etc/ld.so.conf or/and run ldconfig.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.