Giter Site home page Giter Site logo

Error building against PHP 5.6.8 about phpiredis HOT 11 CLOSED

nrk avatar nrk commented on June 5, 2024
Error building against PHP 5.6.8

from phpiredis.

Comments (11)

nirbhabbarat avatar nirbhabbarat commented on June 5, 2024

Facing the same issue on Centos 6.5

from phpiredis.

rshepherd avatar rshepherd commented on June 5, 2024

Same issue here..

Hiredis: 0.13
Os: Ubuntu 14.04 LTS
Php: PHP 5.5.9-1ubuntu4.9

I notice that this issue was first filed 12 days ago. 13 days go, hiredis released a new version.

I suspect whats happened is that the new version of hiredis is not compatible with phpiredis. I am going to try installing an older version of hiredis and compiling against that.

from phpiredis.

rshepherd avatar rshepherd commented on June 5, 2024

My hypothesis seems to be holding up. I tried to build phpiredis on hiredis 0.12.1 and now I am able to build the module, however there are a number of warnings.

Most of them seem like they are probably benign, but I am not a C expert. I may try going back another version or two of hiredis and see if I can get a clean compile.

/bin/bash /usr/local/share/phpiredis/libtool --mode=compile cc  -I. -I/usr/local/share/phpiredis -DPHP_ATOM_INC -I/usr/local/share/phpiredis/include -I/usr/local/share/phpiredis/main -I/usr/local/share/phpiredis -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/share/phpiredis/phpiredis.c -o phpiredis.lo
libtool: compile:  cc -I. -I/usr/local/share/phpiredis -DPHP_ATOM_INC -I/usr/local/share/phpiredis/include -I/usr/local/share/phpiredis/main -I/usr/local/share/phpiredis -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/share/phpiredis/phpiredis.c  -fPIC -DPIC -o .libs/phpiredis.o
/usr/local/share/phpiredis/phpiredis.c: In function 'zif_phpiredis_multi_command':
/usr/local/share/phpiredis/phpiredis.c:224:9: warning: passing argument 2 of 'redisGetReply' from incompatible pointer type [enabled by default]
         if (redisGetReply(connection->c, &reply) != REDIS_OK) {
         ^
In file included from /usr/local/share/phpiredis/phpiredis.c:1:0:
/usr/local/include/hiredis/hiredis.h:163:5: note: expected 'void **' but argument is of type 'struct redisReply **'
 int redisGetReply(redisContext *c, void **reply);
     ^
/usr/local/share/phpiredis/phpiredis.c: In function 'zif_phpiredis_multi_command_bs':
/usr/local/share/phpiredis/phpiredis.c:294:9: warning: passing argument 3 of 'redisAppendCommandArgv' from incompatible pointer type [enabled by default]
         redisAppendCommandArgv(connection->c, cmdSize, cmdElements, cmdElementslen);
         ^
In file included from /usr/local/share/phpiredis/phpiredis.c:1:0:
/usr/local/include/hiredis/hiredis.h:174:5: note: expected 'const char **' but argument is of type 'char **'
 int redisAppendCommandArgv(redisContext *c, int argc, const char **argv, const size_t *argvlen);
     ^
/usr/local/share/phpiredis/phpiredis.c:313:9: warning: passing argument 2 of 'redisGetReply' from incompatible pointer type [enabled by default]
         if (redisGetReply(connection->c, &reply) != REDIS_OK) {
         ^
In file included from /usr/local/share/phpiredis/phpiredis.c:1:0:
/usr/local/include/hiredis/hiredis.h:163:5: note: expected 'void **' but argument is of type 'struct redisReply **'
 int redisGetReply(redisContext *c, void **reply);
     ^
/usr/local/share/phpiredis/phpiredis.c: In function 'zif_phpiredis_command':
/usr/local/share/phpiredis/phpiredis.c:352:9: warning: format not a string literal and no format arguments [-Wformat-security]
         php_error_docref(NULL TSRMLS_CC, E_WARNING, reply->str);
         ^
/usr/local/share/phpiredis/phpiredis.c: In function 'zif_phpiredis_command_bs':
/usr/local/share/phpiredis/phpiredis.c:420:5: warning: passing argument 3 of 'redisAppendCommandArgv' from incompatible pointer type [enabled by default]
     redisAppendCommandArgv(connection->c, argc, argv, (const size_t *) argvlen);
     ^
In file included from /usr/local/share/phpiredis/phpiredis.c:1:0:
/usr/local/include/hiredis/hiredis.h:174:5: note: expected 'const char **' but argument is of type 'char **'
 int redisAppendCommandArgv(redisContext *c, int argc, const char **argv, const size_t *argvlen);
     ^
/usr/local/share/phpiredis/phpiredis.c:428:5: warning: passing argument 2 of 'redisGetReply' from incompatible pointer type [enabled by default]
     if (redisGetReply(connection->c, &reply) != REDIS_OK) {
     ^
In file included from /usr/local/share/phpiredis/phpiredis.c:1:0:
/usr/local/include/hiredis/hiredis.h:163:5: note: expected 'void **' but argument is of type 'struct redisReply **'
 int redisGetReply(redisContext *c, void **reply);
     ^
/usr/local/share/phpiredis/phpiredis.c: In function 'zif_phpiredis_format_command':
/usr/local/share/phpiredis/phpiredis.c:487:5: warning: passing argument 3 of 'redisFormatCommandArgv' from incompatible pointer type [enabled by default]
     cmdlen = redisFormatCommandArgv(&cmd, size, elements, elementslen);
     ^
In file included from /usr/local/share/phpiredis/phpiredis.c:1:0:
/usr/local/include/hiredis/hiredis.h:126:5: note: expected 'const char **' but argument is of type 'char **'
 int redisFormatCommandArgv(char **target, int argc, const char **argv, const size_t *argvlen);
     ^
/bin/bash /usr/local/share/phpiredis/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/local/share/phpiredis/include -I/usr/local/share/phpiredis/main -I/usr/local/share/phpiredis -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -o phpiredis.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/share/phpiredis/modules  phpiredis.lo -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lhiredis
libtool: link: cc -shared  -fPIC -DPIC  .libs/phpiredis.o   -L/usr/local/lib -lhiredis  -O2 -Wl,-rpath -Wl,/usr/local/lib   -Wl,-soname -Wl,phpiredis.so -o .libs/phpiredis.so
libtool: link: ( cd ".libs" && rm -f "phpiredis.la" && ln -s "../phpiredis.la" "phpiredis.la" )
/bin/bash /usr/local/share/phpiredis/libtool --mode=install cp ./phpiredis.la /usr/local/share/phpiredis/modules
libtool: install: cp ./.libs/phpiredis.so /usr/local/share/phpiredis/modules/phpiredis.so
libtool: install: cp ./.libs/phpiredis.lai /usr/local/share/phpiredis/modules/phpiredis.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin" ldconfig -n /usr/local/share/phpiredis/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/share/phpiredis/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

from phpiredis.

nirbhabbarat avatar nirbhabbarat commented on June 5, 2024

Yep, its working with hiredis 0.12.1

from phpiredis.

rshepherd avatar rshepherd commented on June 5, 2024

Did you see the above compiler warnings when building?

from phpiredis.

nirbhabbarat avatar nirbhabbarat commented on June 5, 2024

/bin/sh /home/vagrant/phpiredis/libtool --mode=compile cc -I. -I/home/vagrant/phpiredis -DPHP_ATOM_INC -I/home/vagrant/phpiredis/include -I/home/vagrant/phpiredis/main -I/home/vagrant/phpiredis -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /home/vagrant/phpiredis/phpiredis.c -o phpiredis.lo
mkdir .libs
cc -I. -I/home/vagrant/phpiredis -DPHP_ATOM_INC -I/home/vagrant/phpiredis/include -I/home/vagrant/phpiredis/main -I/home/vagrant/phpiredis -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /home/vagrant/phpiredis/phpiredis.c -fPIC -DPIC -o .libs/phpiredis.o
/home/vagrant/phpiredis/phpiredis.c: In function 'zif_phpiredis_multi_command':
/home/vagrant/phpiredis/phpiredis.c:224: warning: passing argument 2 of 'redisGetReply' from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:163: note: expected 'void *' but argument is of type 'struct redisReply *'
/home/vagrant/phpiredis/phpiredis.c: In function 'zif_phpiredis_multi_command_bs':
/home/vagrant/phpiredis/phpiredis.c:294: warning: passing argument 3 of 'redisAppendCommandArgv' from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:174: note: expected 'const char *' but argument is of type 'char *'
/home/vagrant/phpiredis/phpiredis.c:313: warning: passing argument 2 of 'redisGetReply' from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:163: note: expected 'void *' but argument is of type 'struct redisReply *'
/home/vagrant/phpiredis/phpiredis.c: In function 'zif_phpiredis_command_bs':
/home/vagrant/phpiredis/phpiredis.c:420: warning: passing argument 3 of 'redisAppendCommandArgv' from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:174: note: expected 'const char *' but argument is of type 'char *'
/home/vagrant/phpiredis/phpiredis.c:428: warning: passing argument 2 of 'redisGetReply' from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:163: note: expected 'void *' but argument is of type 'struct redisReply *'
/home/vagrant/phpiredis/phpiredis.c: In function 'zif_phpiredis_format_command':
/home/vagrant/phpiredis/phpiredis.c:487: warning: passing argument 3 of 'redisFormatCommandArgv' from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:126: note: expected 'const char *' but argument is of type 'char *'
/bin/sh /home/vagrant/phpiredis/libtool --mode=link cc -DPHP_ATOM_INC -I/home/vagrant/phpiredis/include -I/home/vagrant/phpiredis/main -I/home/vagrant/phpiredis -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -o phpiredis.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/vagrant/phpiredis/modules phpiredis.lo -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lhiredis
cc -shared .libs/phpiredis.o -L/usr/local/lib -lhiredis -Wl,-rpath -Wl,/usr/local/lib -Wl,-soname -Wl,phpiredis.so -o .libs/phpiredis.so
creating phpiredis.la
(cd .libs && rm -f phpiredis.la && ln -s ../phpiredis.la phpiredis.la)
/bin/sh /home/vagrant/phpiredis/libtool --mode=install cp ./phpiredis.la /home/vagrant/phpiredis/modules
cp ./.libs/phpiredis.so /home/vagrant/phpiredis/modules/phpiredis.so
cp ./.libs/phpiredis.lai /home/vagrant/phpiredis/modules/phpiredis.la

from phpiredis.

rshepherd avatar rshepherd commented on June 5, 2024

Ok, as I suspected. I am not comfortable with those warnings in a production system. I am going to try and work backwards from 0.12.1 and see if I find a version that compiles cleanly. I will post my results.

from phpiredis.

nrk avatar nrk commented on June 5, 2024

Guys I'm really sorry but I won't be able to have a look at this issue until the end of May, I'm about to put an end to a long busy period that kept me away from my open-source duties and will be leaving on a trip for about 3 weeks.

If any of you have the time and the will to open a pull request that fixes the build issues with this recent hiredis release I'll be more than happy to hit the merge button as soon as possibile (I'll be leaving in 10 days, at least I can do that much until then).

Thanks!

from phpiredis.

rubensayshi avatar rubensayshi commented on June 5, 2024

hmm, yea the weird thing is that regardless of which hiredis version I try, it gives those warnings with all of them ... even v0.10.1, which is from Jun 19, 2011 !

I don't recall ever seeing these warnings before, but I might have just ignored them in the past and they could have been there for ever ...

looking at the commit history it doesn't look like anything changed that could have caused this warning:

/work/phpiredis/phpiredis.c:224:9: warning: passing argument 2 of 'redisGetReply' from incompatible pointer type [enabled by default]
         if (redisGetReply(connection->c, &reply) != REDIS_OK) {

from phpiredis.

nirbhabbarat avatar nirbhabbarat commented on June 5, 2024

Try

EXTRA_LDFLAGS=/usr/local/lib phpize && ./configure --enable-phpiredis --prefix=/usr/local --with-php-config=/usr/local/bin/php-config

from phpiredis.

nrk avatar nrk commented on June 5, 2024

The php7 branch should have fixed any related problem, just tested on 5.6.8 to make sure and it builds just fine. Even all of the warnings should have gone now. Please report back if you still see any issue.

from phpiredis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.