krakjoe/pthreads

Cannot install via pecl

prolic opened this issue · 2 comments

Environment

  • PHP: 7.3.7
  • pthreads: 3.1.6
  • OS: Ubuntu

Summary

sudo pecl install pthreads

Starting to download pthreads-3.1.6.tgz (80,932 bytes)
...................done: 80,932 bytes
28 source files, building
running: phpize
Configuring for:
PHP Api Version:         20180731
Zend Module Api No:      20180731
Zend Extension Api No:   320180731

....

/tmp/pear/temp/pthreads/classes/worker.h:55:49: note: in definition of macro ‘PTHREADS_WORKER_COLLECTOR_INIT’
  call.fcc.function_handler = zend_hash_find_ptr(call.fci.function_table, Z_STR(call.fci.function_name)); \
                                                 ^~~~
In file included from /opt/php/7.3.7/include/php/Zend/zend.h:32:0,
                 from /opt/php/7.3.7/include/php/main/php.h:33,
                 from /tmp/pear/temp/pthreads/src/pthreads.h:37,
                 from /tmp/pear/temp/pthreads/php_pthreads.c:22:
/opt/php/7.3.7/include/php/Zend/zend_hash.h:788:33: note: expected ‘const HashTable * {aka const struct _zend_array *}’ but argument is of type ‘zend_function_entry * {aka struct _zend_function_entry *}’
 static zend_always_inline void *zend_hash_find_ptr(const HashTable *ht, zend_string *key)
                                 ^~~~~~~~~~~~~~~~~~
In file included from /tmp/pear/temp/pthreads/php_pthreads.h:43:0,
                 from /tmp/pear/temp/pthreads/php_pthreads.c:26:
/tmp/pear/temp/pthreads/classes/worker.h:57:10: error: ‘zend_fcall_info_cache {aka struct _zend_fcall_info_cache}’ has no member named ‘initialized’
  call.fcc.initialized = 1; \
          ^
/tmp/pear/temp/pthreads/classes/pool.h:293:4: note: in expansion of macro ‘PTHREADS_WORKER_COLLECTOR_INIT’
    PTHREADS_WORKER_COLLECTOR_INIT(call, Z_OBJ_P(worker));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:196: recipe for target 'php_pthreads.lo' failed
make: *** [php_pthreads.lo] Error 1
ERROR: `make' failed

You need 3.2.0 or higher. pecl doesn't have any up to date version. You'll need to build from git sources.

thanks @dktapps