php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71138 pecl gnupg fails to build with php-7.x
Submitted: 2015-12-16 16:01 UTC Modified: 2016-08-31 11:37 UTC
Votes:7
Avg. Score:4.6 ± 0.5
Reproduced:7 of 7 (100.0%)
Same Version:6 (85.7%)
Same OS:6 (85.7%)
From: Vincent dot Riera at imgtec dot com Assigned: bukka (profile)
Status: Closed Package: gnupg (PECL)
PHP Version: 7.0.0 OS: Linux
Private report: No CVE-ID: None
 [2015-12-16 16:01 UTC] Vincent dot Riera at imgtec dot com
Description:
------------
Fails to build with PHP-7.x (I have tried with 7.0.1).

Actual result:
--------------
php-gnupg-1.3.6/gnupg.c:127:28: error: unknown type name 'zend_rsrc_list_entry'

...

php-gnupg-1.3.6/gnupg.c:308:49: error: 'gnupg_res_dtor' undeclared (first use in this function)

...

php-gnupg-1.3.6/gnupg.c:409:5: error: too many arguments to function 'zend_hash_find'

...

gnupg.c:466:87: error: macro "add_assoc_string" passed 4 arguments, but takes just 3

...

gnupg.c:466:9: error: 'add_assoc_string' undeclared (first use in this function)

...

gnupg.c:508:36: error: expected expression before 'gnupg_object'

...

gnupg.c:601:63: error: macro "RETURN_STRINGL" passed 3 arguments, but takes just 2

...

gnupg.c:601:3: error: 'RETURN_STRINGL' undeclared (first use in this function)

And many more.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-25 22:20 UTC] seander@php.net
-Assigned To: +Assigned To: seander
 [2015-12-25 22:20 UTC] seander@php.net
Hi Vincent!

I have some spare time, and will be porting this today. Will work with jimjag on getting a new version uploaded soon.

thanks
 [2015-12-27 08:04 UTC] seander@php.net
This has been ported to PHP 7 https://github.com/Sean-Der/pecl-encryption-gnupg

I am only able to get 33% of the tests passing on 5.5 (so only 33% in PHP 7 as well) working with the maintainer on getting this fixed and uploaded. If you have your own tests/software to run against the extension the feedback would be helpful.

thanks
 [2016-05-02 08:42 UTC] prachpub at gmail dot com
Hi Sean,

Do you have plan to release it soon?

The pecl gnupg package has removed from Debian.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820102
 [2016-05-03 07:30 UTC] seander@php.net
Hey everyone,

I just finished porting this and 100% of the tests pass locally for me. I am going to work with the Debian maintainers to get this packaged.

I also need to get maintainer access to the PECL page, currently I can't upload a new version on the owner hasn't responded to emails.
 [2016-05-03 07:58 UTC] prach at debian dot org
Hi Sean,

It is great to hear that, I can re-upload it to Debian.
Could you tag a release?

https://github.com/Sean-Der/pecl-encryption-gnupg/releases
 [2016-05-03 08:09 UTC] seander@php.net
Thanks for the quick response prach!

I tagged a release 2.0.0. Is it an issue that it is not 5.* compatible?
 [2016-05-10 06:07 UTC] prach at debian dot org
I'm waiting for its release on the PECL page.

https://pecl.php.net/package/gnupg
 [2016-06-05 18:33 UTC] bukka@php.net
-Assigned To: seander +Assigned To: bukka
 [2016-06-05 18:33 UTC] bukka@php.net
There are small changes in the plan. We have got a new official repo with the PHP 5 and PHP 7 compatible version:

https://github.com/php-gnupg/php-gnupg

All seems to work fine. I'm going to test compatibility with older PHP version in the next week or two and then plan to do a beta RC for 1.4. The final release should be done soon after that hopofully.

I have got couple improvements in pipe line but decided to not to add them to 1.4 to not extra delay the release. They should go to 1.5 with some code clean ups and sorting out the test (currently they are dependencies between them).
 [2016-06-30 22:09 UTC] x309server at googlemail dot com
Arch Linux (up to date), PHP 7.0.8, quite normal configuration with apache.
"pecl install gnupg" console output:

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading gnupg-1.3.6.tgz ...
Starting to download gnupg-1.3.6.tgz (19,273 bytes)
......done: 19,273 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
building in /tmp/pear/temp/pear-build-rootDpseYV/gnupg-1.3.6
running: /tmp/pear/temp/gnupg/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -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
checking for PHP extension directory... /usr/lib/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for gnupg support... yes, shared
checking for gnupg files in default path... found in /usr/include
checking for gpgme_check_version in -lgpgme... yes
checking for gpg... /usr/bin/gpg
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-rootDpseYV/gnupg-1.3.6/libtool --mode=compile cc  -I. -I/tmp/pear/temp/gnupg -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootDpseYV/gnupg-1.3.6/include -I/tmp/pear/temp/pear-build-rootDpseYV/gnupg-1.3.6/main -I/tmp/pear/temp/gnupg -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  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/gnupg/gnupg.c -o gnupg.lo
mkdir .libs
 cc -I. -I/tmp/pear/temp/gnupg -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootDpseYV/gnupg-1.3.6/include -I/tmp/pear/temp/pear-build-rootDpseYV/gnupg-1.3.6/main -I/tmp/pear/temp/gnupg -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/gnupg/gnupg.c  -fPIC -DPIC -o .libs/gnupg.o
/tmp/pear/temp/gnupg/gnupg.c:127:28: error: unknown type name ‘zend_rsrc_list_entry’
 static void gnupg_res_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
                            ^~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zm_startup_gnupg’:
/tmp/pear/temp/gnupg/gnupg.c:308:49: error: ‘gnupg_res_dtor’ undeclared (first use in this function)
  le_gnupg   = zend_register_list_destructors_ex(gnupg_res_dtor, NULL, "ctx", module_number);
                                                 ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:308:49: note: each undeclared identifier is reported only once for each function it appears in
/tmp/pear/temp/gnupg/gnupg.c: In function ‘passphrase_cb’:
/tmp/pear/temp/gnupg/gnupg.c:409:37: warning: passing argument 2 of ‘zend_hash_find’ from incompatible pointer type [-Wincompatible-pointer-types]
  if(zend_hash_find(intern->signkeys,(char *) uid,17,(void **) &passphrase)==FAILURE){
                                     ^
In file included from /usr/include/php/Zend/zend.h:36:0,
                 from /usr/include/php/main/php.h:35,
                 from /tmp/pear/temp/gnupg/gnupg.c:20:
/usr/include/php/Zend/zend_hash.h:154:30: note: expected ‘zend_string * {aka struct _zend_string *}’ but argument is of type ‘char *’
 ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
                              ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:409:5: error: too many arguments to function ‘zend_hash_find’
  if(zend_hash_find(intern->signkeys,(char *) uid,17,(void **) &passphrase)==FAILURE){
     ^~~~~~~~~~~~~~
In file included from /usr/include/php/Zend/zend.h:36:0,
                 from /usr/include/php/main/php.h:35,
                 from /tmp/pear/temp/gnupg/gnupg.c:20:
/usr/include/php/Zend/zend_hash.h:154:30: note: declared here
 ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
                              ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:409:75: warning: comparison between pointer and integer
  if(zend_hash_find(intern->signkeys,(char *) uid,17,(void **) &passphrase)==FAILURE){
                                                                           ^~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘passphrase_decrypt_cb’:
/tmp/pear/temp/gnupg/gnupg.c:440:43: warning: passing argument 2 of ‘zend_hash_find’ from incompatible pointer type [-Wincompatible-pointer-types]
     if(zend_hash_find(intern->decryptkeys,(char *) uid,17,(void **) &passphrase)==FAILURE){
                                           ^
In file included from /usr/include/php/Zend/zend.h:36:0,
                 from /usr/include/php/main/php.h:35,
                 from /tmp/pear/temp/gnupg/gnupg.c:20:
/usr/include/php/Zend/zend_hash.h:154:30: note: expected ‘zend_string * {aka struct _zend_string *}’ but argument is of type ‘char *’
 ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
                              ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:440:8: error: too many arguments to function ‘zend_hash_find’
     if(zend_hash_find(intern->decryptkeys,(char *) uid,17,(void **) &passphrase)==FAILURE){
        ^~~~~~~~~~~~~~
In file included from /usr/include/php/Zend/zend.h:36:0,
                 from /usr/include/php/main/php.h:35,
                 from /tmp/pear/temp/gnupg/gnupg.c:20:
/usr/include/php/Zend/zend_hash.h:154:30: note: declared here
 ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
                              ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:440:81: warning: comparison between pointer and integer
     if(zend_hash_find(intern->decryptkeys,(char *) uid,17,(void **) &passphrase)==FAILURE){
                                                                                 ^~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘gnupg_fetchsignatures’:
/tmp/pear/temp/gnupg/gnupg.c:464:9: warning: implicit declaration of function ‘ALLOC_INIT_ZVAL’ [-Wimplicit-function-declaration]
         ALLOC_INIT_ZVAL     (sig_arr);
         ^~~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:466:87: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
         add_assoc_string    (sig_arr,  "fingerprint",  gpgme_signatures->fpr,        1);
                                                                                       ^
/tmp/pear/temp/gnupg/gnupg.c:466:9: error: ‘add_assoc_string’ undeclared (first use in this function)
         add_assoc_string    (sig_arr,  "fingerprint",  gpgme_signatures->fpr,        1);
         ^~~~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_init’:
/tmp/pear/temp/gnupg/gnupg.c:486:2: warning: implicit declaration of function ‘ZEND_REGISTER_RESOURCE’ [-Wimplicit-function-declaration]
  ZEND_REGISTER_RESOURCE(return_value,intern,le_gnupg);
  ^~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_setarmor’:
/tmp/pear/temp/gnupg/gnupg.c:508:9: warning: implicit declaration of function ‘ZEND_FETCH_RESOURCE’ [-Wimplicit-function-declaration]
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
         ^~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:508:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_seterrormode’:
/tmp/pear/temp/gnupg/gnupg.c:534:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_setsignmode’:
/tmp/pear/temp/gnupg/gnupg.c:569:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_geterror’:
/tmp/pear/temp/gnupg/gnupg.c:596:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:601:63: error: macro "RETURN_STRINGL" passed 3 arguments, but takes just 2
   RETURN_STRINGL(intern->errortxt, strlen(intern->errortxt), 1);
                                                               ^
/tmp/pear/temp/gnupg/gnupg.c:601:3: error: ‘RETURN_STRINGL’ undeclared (first use in this function)
   RETURN_STRINGL(intern->errortxt, strlen(intern->errortxt), 1);
   ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_keyinfo’:
/tmp/pear/temp/gnupg/gnupg.c:643:30: error: expected expression before ‘gnupg_object’
   ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                              ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:674:64: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
    add_assoc_string    (userid, "name",  gpgme_userid->name,  1);
                                                                ^
/tmp/pear/temp/gnupg/gnupg.c:674:4: error: ‘add_assoc_string’ undeclared (first use in this function)
    add_assoc_string    (userid, "name",  gpgme_userid->name,  1);
    ^~~~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:675:65: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
    add_assoc_string (userid, "comment", gpgme_userid->comment, 1);
                                                                 ^
/tmp/pear/temp/gnupg/gnupg.c:676:64: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
    add_assoc_string    (userid, "email", gpgme_userid->email, 1);
                                                                ^
/tmp/pear/temp/gnupg/gnupg.c:677:62: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
    add_assoc_string    (userid, "uid",  gpgme_userid->uid,  1);
                                                              ^
/tmp/pear/temp/gnupg/gnupg.c:694:70: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
     add_assoc_string    (subkey, "fingerprint", gpgme_subkey->fpr,  1);
                                                                      ^
/tmp/pear/temp/gnupg/gnupg.c:697:66: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
    add_assoc_string    (subkey, "keyid",  gpgme_subkey->keyid,  1);
                                                                  ^
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_addsignkey’:
/tmp/pear/temp/gnupg/gnupg.c:742:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:752:146: error: macro "zend_hash_add" passed 6 arguments, but takes just 3
     zend_hash_add(intern->signkeys, (char *) gpgme_subkey->keyid, (uint) strlen(gpgme_subkey->keyid)+1, passphrase, (uint) passphrase_len+1, NULL);
                                                                                                                                                  ^
/tmp/pear/temp/gnupg/gnupg.c:752:5: error: ‘zend_hash_add’ undeclared (first use in this function)
     zend_hash_add(intern->signkeys, (char *) gpgme_subkey->keyid, (uint) strlen(gpgme_subkey->keyid)+1, passphrase, (uint) passphrase_len+1, NULL);
     ^~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_adddecryptkey’:
/tmp/pear/temp/gnupg/gnupg.c:786:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:795:154: error: macro "zend_hash_add" passed 6 arguments, but takes just 3
          zend_hash_add(intern->decryptkeys, (char *) gpgme_subkey->keyid, (uint) strlen(gpgme_subkey->keyid)+1, passphrase, (uint) passphrase_len+1, NULL);
                                                                                                                                                          ^
/tmp/pear/temp/gnupg/gnupg.c:795:10: error: ‘zend_hash_add’ undeclared (first use in this function)
          zend_hash_add(intern->decryptkeys, (char *) gpgme_subkey->keyid, (uint) strlen(gpgme_subkey->keyid)+1, passphrase, (uint) passphrase_len+1, NULL);
          ^~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_addencryptkey’:
/tmp/pear/temp/gnupg/gnupg.c:821:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_clearsignkeys’:
/tmp/pear/temp/gnupg/gnupg.c:846:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_clearencryptkeys’:
/tmp/pear/temp/gnupg/gnupg.c:865:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_cleardecryptkeys’:
/tmp/pear/temp/gnupg/gnupg.c:883:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_sign’:
/tmp/pear/temp/gnupg/gnupg.c:916:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:955:37: error: macro "RETVAL_STRINGL" passed 3 arguments, but takes just 2
   RETVAL_STRINGL (userret,ret_size,1);
                                     ^
/tmp/pear/temp/gnupg/gnupg.c:955:3: error: ‘RETVAL_STRINGL’ undeclared (first use in this function)
   RETVAL_STRINGL (userret,ret_size,1);
   ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_encrypt’:
/tmp/pear/temp/gnupg/gnupg.c:986:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1016:37: error: macro "RETVAL_STRINGL" passed 3 arguments, but takes just 2
  RETVAL_STRINGL  (userret,ret_size,1);
                                     ^
/tmp/pear/temp/gnupg/gnupg.c:1016:2: error: ‘RETVAL_STRINGL’ undeclared (first use in this function)
  RETVAL_STRINGL  (userret,ret_size,1);
  ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_encryptsign’:
/tmp/pear/temp/gnupg/gnupg.c:1048:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1099:37: error: macro "RETVAL_STRINGL" passed 3 arguments, but takes just 2
  RETVAL_STRINGL  (userret,ret_size,1);
                                     ^
/tmp/pear/temp/gnupg/gnupg.c:1099:2: error: ‘RETVAL_STRINGL’ undeclared (first use in this function)
  RETVAL_STRINGL  (userret,ret_size,1);
  ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_verify’:
/tmp/pear/temp/gnupg/gnupg.c:1131:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1183:72: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
             ZVAL_STRINGL         (plain_text, gpg_plain,gpg_plain_len,1);
                                                                        ^
/tmp/pear/temp/gnupg/gnupg.c:1183:13: error: ‘ZVAL_STRINGL’ undeclared (first use in this function)
             ZVAL_STRINGL         (plain_text, gpg_plain,gpg_plain_len,1);
             ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_decrypt’:
/tmp/pear/temp/gnupg/gnupg.c:1214:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1245:38: error: macro "RETVAL_STRINGL" passed 3 arguments, but takes just 2
  RETVAL_STRINGL   (userret,ret_size,1);
                                      ^
/tmp/pear/temp/gnupg/gnupg.c:1245:2: error: ‘RETVAL_STRINGL’ undeclared (first use in this function)
  RETVAL_STRINGL   (userret,ret_size,1);
  ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_decryptverify’:
/tmp/pear/temp/gnupg/gnupg.c:1278:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1301:46: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
  ZVAL_STRINGL   (plaintext,userret,ret_size,1);
                                              ^
/tmp/pear/temp/gnupg/gnupg.c:1301:2: error: ‘ZVAL_STRINGL’ undeclared (first use in this function)
  ZVAL_STRINGL   (plaintext,userret,ret_size,1);
  ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_export’:
/tmp/pear/temp/gnupg/gnupg.c:1341:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1353:45: error: macro "RETVAL_STRINGL" passed 3 arguments, but takes just 2
  RETVAL_STRINGL          (userret,ret_size,1);
                                             ^
/tmp/pear/temp/gnupg/gnupg.c:1353:2: error: ‘RETVAL_STRINGL’ undeclared (first use in this function)
  RETVAL_STRINGL          (userret,ret_size,1);
  ^~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_import’:
/tmp/pear/temp/gnupg/gnupg.c:1381:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1408:75: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
   add_assoc_string  (return_value, "fingerprint",  result->imports->fpr, 1);
                                                                           ^
/tmp/pear/temp/gnupg/gnupg.c:1408:3: error: ‘add_assoc_string’ undeclared (first use in this function)
   add_assoc_string  (return_value, "fingerprint",  result->imports->fpr, 1);
   ^~~~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_deletekey’:
/tmp/pear/temp/gnupg/gnupg.c:1433:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_gettrustlist’:
/tmp/pear/temp/gnupg/gnupg.c:1470:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1483:56: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
   add_assoc_string  (sub_arr, "keyid",  item->keyid,  1);
                                                        ^
/tmp/pear/temp/gnupg/gnupg.c:1483:3: error: ‘add_assoc_string’ undeclared (first use in this function)
   add_assoc_string  (sub_arr, "keyid",  item->keyid,  1);
   ^~~~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1484:70: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
   add_assoc_string     (sub_arr,   "ownertrust", item->owner_trust, 1);
                                                                      ^
/tmp/pear/temp/gnupg/gnupg.c:1485:67: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
   add_assoc_string     (sub_arr,   "validity",  item->validity,  1);
                                                                   ^
/tmp/pear/temp/gnupg/gnupg.c:1486:61: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
   add_assoc_string     (sub_arr,   "name",   item->name,   1);
                                                             ^
/tmp/pear/temp/gnupg/gnupg.c: In function ‘zif_gnupg_listsignatures’:
/tmp/pear/temp/gnupg/gnupg.c:1515:36: error: expected expression before ‘gnupg_object’
         ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
                                    ^~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1540:63: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
    add_assoc_string (sig_arr, "uid",  gpgme_signature->uid,  1);
                                                               ^
/tmp/pear/temp/gnupg/gnupg.c:1540:4: error: ‘add_assoc_string’ undeclared (first use in this function)
    add_assoc_string (sig_arr, "uid",  gpgme_signature->uid,  1);
    ^~~~~~~~~~~~~~~~
/tmp/pear/temp/gnupg/gnupg.c:1541:77: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
    add_assoc_string    (sig_arr,   "name",     gpgme_signature->name,      1);
                                                                             ^
/tmp/pear/temp/gnupg/gnupg.c:1542:77: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
    add_assoc_string    (sig_arr,   "email",    gpgme_signature->email,     1);
                                                                             ^
/tmp/pear/temp/gnupg/gnupg.c:1543:77: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
    add_assoc_string    (sig_arr,   "comment",  gpgme_signature->comment,   1);
                                                                             ^
make: *** [Makefile:194: gnupg.lo] Error 1
ERROR: `make' failed
 [2016-06-30 22:45 UTC] nish dot aravamudan at canonical dot com
1.4.0RC1 is the first release with PHP7 support, afaict. 1.3.6 is from last year, and definitely won't work.

You wanted to do: `pecl install gnupg-1.4.0RC1`. Which does seem to compile fine with PHP7.
 [2016-07-01 00:16 UTC] anubis at overthemonkey dot com
You can also use the AUR package I maintain.  It has been updated to the RC: https://aur.archlinux.org/packages/php-gnupg/
 [2016-07-03 21:45 UTC] x309server at googlemail dot com
Thx for helping! With a x86-Architecture it will work fine.
But I tried both ways to install the RC on a RaspberryPi (ARM) without success... (Arch Linux ARM, Kernel: armv7l Linux 4.4.14-1-ARCH)
"pecl install gnupg-1.4.0RC1" output:

downloading gnupg-1.4.0RC1.tgz ...
Starting to download gnupg-1.4.0RC1.tgz (27,969 bytes)
.........done: 27,969 bytes
6 source files, building
running: phpize
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
building in /tmp/pear/temp/pear-build-rootGVJASE/gnupg-1.4.0RC1
running: /tmp/pear/temp/gnupg/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... yes
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking target system type... armv7l-unknown-linux-gnueabihf
checking for PHP prefix... /usr
checking for PHP includes... -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
checking for PHP extension directory... /usr/lib/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for gnupg support... yes, shared
checking for gnupg files in default path... found in /usr/include
checking for gpgme_check_version in -lgpgme... yes
checking for gpg... /usr/bin/gpg
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-rootGVJASE/gnupg-1.4.0RC1/libtool --mode=compile cc  -I. -I/tmp/pear/temp/gnupg -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootGVJASE/gnupg-1.4.0RC1/include -I/tmp/pear/temp/pear-build-rootGVJASE/gnupg-1.4.0RC1/main -I/tmp/pear/temp/gnupg -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  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/gnupg/gnupg.c -o gnupg.lo
mkdir .libs
 cc -I. -I/tmp/pear/temp/gnupg -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootGVJASE/gnupg-1.4.0RC1/include -I/tmp/pear/temp/pear-build-rootGVJASE/gnupg-1.4.0RC1/main -I/tmp/pear/temp/gnupg -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/gnupg/gnupg.c  -fPIC -DPIC -o .libs/gnupg.o
In file included from /tmp/pear/temp/gnupg/php_gnupg.h:33:0,
                 from /tmp/pear/temp/gnupg/gnupg.c:25:
/usr/include/gpgme.h:102:2: error: #error GPGME was compiled with _FILE_OFFSET_BITS = 64, please see the section "Largefile support (LFS)" in the GPGME manual.
 #error GPGME was compiled with _FILE_OFFSET_BITS = 64, please see the section "Largefile support (LFS)" in the GPGME manual.
  ^~~~~
make: *** [Makefile:194: gnupg.lo] Error 1
ERROR: `make' failed
 [2016-08-31 11:37 UTC] bukka@php.net
-Status: Assigned +Status: Closed
 [2016-08-31 11:37 UTC] bukka@php.net
1.4.0 stable is out!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 20:01:28 2024 UTC