php.net |  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: 2017-10-24 07:07 UTC
Votes:2
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:
Status: Open Package: solr (PECL)
PHP Version: 5.6.21 OS: Ubuntu 16.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-05-17 06:53 UTC] naoki-kawamukai at cybozu dot co dot jp
Description:
------------
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-03 18:15 UTC] omars@php.net
-Assigned To: +Assigned To: nick wall
 [2016-07-03 18:15 UTC] omars@php.net
-Assigned To: nick wall +Assigned To: fyb3roptik
 [2017-10-24 07:07 UTC] kalle@php.net
-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.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC