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: 2020-06-28 07:56 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: omars (profile)
Status: Closed Package: solr (PECL)
PHP Version: 5.6.21 OS: Ubuntu 16.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: naoki-kawamukai at cybozu dot co dot jp
New email:
PHP Version: OS:

 

 [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.
 [2020-06-28 07:56 UTC] omars@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: omars
 [2020-06-28 07:56 UTC] omars@php.net
wont fix
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 16:01:30 2024 UTC