|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72228 Compiling Solr extensions statically into PHP5 failed
Submitted: 2016-05-17 06:53 UTC Modified: 2020-06-28 07:56 UTC
Avg. Score:3.0 ± 2.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: naoki-kawamukai at cybozu dot co dot jp Assigned: omars (profile)
Status: Closed Package: solr (PECL)
PHP Version: 5.6.21 OS: Ubuntu 16.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
34 - 34 = ?
Subscribe to this entry?

 [2016-05-17 06:53 UTC] naoki-kawamukai at cybozu dot co dot jp
I cannot compile Solr extension 2.4.0 statically.
But, Solr extension 2.3.0 has no problem.

Test script:
$ tar xzf php-5.6.21.tgz
$ tar xzvf solr-2.4.0.tgz -C php-5.6.21/ext/
$ mv php-5.6.21/ext/solr* php-5.6.21/ext/solr
$ cd php-5.6.21
$ rm configure
$ ./buildconf --force
$ ./configure --enable-solr --with-curl
$ make

Expected result:
Build complete.
Don't forget to run 'make test'.

Actual result:
/home/ubuntu/php-5.6.21/ext/solr/src/php7/php_solr.c:1259:2: note: in expansion of macro ‘zend_hash_init’
  zend_hash_init(SOLR_GLOBAL(functions), nSize, NULL, solr_destroy_function, persistent);
In file included from /home/ubuntu/php-5.6.21/Zend/zend.h:286:0,
                 from /home/ubuntu/php-5.6.21/main/php.h:35,
                 from /home/ubuntu/php-5.6.21/ext/solr/src/php7/php_solr.h:28,
                 from /home/ubuntu/php-5.6.21/ext/solr/src/php7/php_solr.c:23:
/home/ubuntu/php-5.6.21/Zend/zend_hash.h:100:14: note: expected ‘dtor_func_t {aka void (*)(void *)}’ but argument is of type ‘void (*)(zval *) {aka void (*)(struct _zval_struct *)}’
 ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
Makefile:792: recipe for target 'ext/solr/src/php7/php_solr.lo' failed
make: *** [ext/solr/src/php7/php_solr.lo] Error 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-03 18:15 UTC]
-Assigned To: +Assigned To: nick wall
 [2016-07-03 18:15 UTC]
-Assigned To: nick wall +Assigned To: fyb3roptik
 [2017-10-24 07:07 UTC]
-Status: Assigned +Status: Open -Assigned To: fyb3roptik +Assigned To:
 [2017-10-28 18:06 UTC] riteshsingh81 at gmail dot com
It should not use php7.
Rather it should use php5.

function signature of destroy callback is different in PHP5 and PHP7.
 [2017-10-29 16:47 UTC] riteshsingh81 at gmail dot com
Problem seems to be in config.m4.
AC_TRY_COMPILE is selecting PHP7 instead of PHP5.

If someone wants a hack for quick compiling, just replace subdir=src/php7 to subdir=src/php5 so that what ever AC_TRY_COMPILE does, it will always compile php5 code.

PS: The above is a quich hack, and not a solution. It will work since version being compiled is php 5.6.21.
 [2020-06-28 07:56 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: omars
 [2020-06-28 07:56 UTC]
wont fix
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Aug 12 21:01:26 2020 UTC