nrk / phpiredis Goto Github PK
View Code? Open in Web Editor NEWPHP extension for Redis based on Hiredis
License: BSD 2-Clause "Simplified" License
PHP extension for Redis based on Hiredis
License: BSD 2-Clause "Simplified" License
Using this small example, the PHP send forever the command HGETALL
<?php
$link = phpiredis_connect('redis', 6385);
phpiredis_command($link, 'SET foo bar');
var_dump(phpiredis_command($link, 'HGETALL foo'));
Remplace the command 'HGETALL foo'
'HGET foo'
. The command is not sent, but the PHP is still running forever.
Hello,
Can we create a phpiredis connection with a timeout ?
I fount this option in hiredis but not in phpiredis.
Regards
Hi,
we dont know if it is an error, or if we are missing something:
when we connect via 127.0.0.1 all works fine, but when we connect via redis.sock, the phpiredis_command_bs() raises an warning:
$redis= phpiredis_connect("/tmp/redis.sock"); //same warning using "unix:///tmp/redis.sock"
$response = phpiredis_command_bs($redis, array('SET', 'day','monday' ));
Warning: phpiredis_command_bs() expects parameter 1 to be resource, boolean given
...and then redis is not updated.
are we missing something?
Hello.
I have PHP 5.3.19
./configure' '--enable-phpiredis' '--with-hiredis-dir=/usr/local
make
/bin/sh /usr/work/src/phpiredis-master/libtool --mode=compile cc -I. -I/usr/work/src/phpiredis-master -DPHP_ATOM_INC -I/usr/work/src/phpiredis-master/include -I/usr/work/src/phpiredis-master/main -I/usr/work/src/phpiredis-master -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 /usr/work/src/phpiredis-master/phpiredis.c -o phpiredis.lo
cc -I. -I/usr/work/src/phpiredis-master -DPHP_ATOM_INC -I/usr/work/src/phpiredis-master/include -I/usr/work/src/phpiredis-master/main -I/usr/work/src/phpiredis-master -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 /usr/work/src/phpiredis-master/phpiredis.c -fPIC -DPIC -o .libs/phpiredis.o
/usr/work/src/phpiredis-master/phpiredis.c:445: error: conflicting types for ‘convert_redis_to_php’
/usr/work/src/phpiredis-master/phpiredis.c:59: note: previous declaration of ‘convert_redis_to_php’ was here
/usr/work/src/phpiredis-master/phpiredis.c: In function ‘convert_redis_to_php’:
/usr/work/src/phpiredis-master/phpiredis.c:496: error: too few arguments to function ‘convert_redis_to_php’
/usr/work/src/phpiredis-master/phpiredis.c: In function ‘zif_phpiredis_multi_command’:
/usr/work/src/phpiredis-master/phpiredis.c:524: warning: assignment from incompatible pointer type
/usr/work/src/phpiredis-master/phpiredis.c:546: warning: passing argument 2 of ‘redisGetReply’ from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:188: note: expected ‘void *’ but argument is of type ‘struct redisReply *’
/usr/work/src/phpiredis-master/phpiredis.c:553: error: too few arguments to function ‘convert_redis_to_php’
/usr/work/src/phpiredis-master/phpiredis.c: In function ‘zif_phpiredis_multi_command_bs’:
/usr/work/src/phpiredis-master/phpiredis.c:584: warning: assignment from incompatible pointer type
/usr/work/src/phpiredis-master/phpiredis.c:612: warning: passing argument 3 of ‘redisAppendCommandArgv’ from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:195: note: expected ‘const char *’ but argument is of type ‘char *’
/usr/work/src/phpiredis-master/phpiredis.c:629: warning: passing argument 2 of ‘redisGetReply’ from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:188: note: expected ‘void *’ but argument is of type ‘struct redisReply *’
/usr/work/src/phpiredis-master/phpiredis.c:636: error: too few arguments to function ‘convert_redis_to_php’
/usr/work/src/phpiredis-master/phpiredis.c: In function ‘zif_phpiredis_format_command’:
/usr/work/src/phpiredis-master/phpiredis.c:680: warning: passing argument 3 of ‘redisFormatCommandArgv’ from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:161: note: expected ‘const char *’ but argument is of type ‘char *’
/usr/work/src/phpiredis-master/phpiredis.c: In function ‘zif_phpiredis_command’:
/usr/work/src/phpiredis-master/phpiredis.c:702: warning: assignment from incompatible pointer type
/usr/work/src/phpiredis-master/phpiredis.c:728: error: too few arguments to function ‘convert_redis_to_php’
/usr/work/src/phpiredis-master/phpiredis.c: In function ‘zif_phpiredis_command_bs’:
/usr/work/src/phpiredis-master/phpiredis.c:749: warning: assignment from incompatible pointer type
/usr/work/src/phpiredis-master/phpiredis.c:787: warning: passing argument 3 of ‘redisAppendCommandArgv’ from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:195: note: expected ‘const char *’ but argument is of type ‘char *’
/usr/work/src/phpiredis-master/phpiredis.c:794: warning: passing argument 2 of ‘redisGetReply’ from incompatible pointer type
/usr/local/include/hiredis/hiredis.h:188: note: expected ‘void *’ but argument is of type ‘struct redisReply *’
/usr/work/src/phpiredis-master/phpiredis.c:806: error: too few arguments to function ‘convert_redis_to_php’
make: *** [phpiredis.lo] Error 1
Can you help me to compile?
Hi,
I have put this line in my composer file "ext-phpiredis": "*"
.
When I run composer update
I get this error: - The requested PHP extension ext-phpiredis * is missing from your system. Install or enable PHP's phpiredis extension.
I can't seem to find out to install your package on with homebrew or ubuntu apt-get
anywhere.
I don't want to have to install and make the package myself.
Are you on any package manager.
I have compiled phpiredis with following commands:
git clone https://github.com/nrk/phpiredis.git
cd phpiredis
phpize && ./configure --enable-phpiredis
make && make install
And included library as follows: echo extension=/usr/lib64/php/5.5/modules/phpiredis.so > /etc/php.d/redis.ini
But I got this error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/5.5/modules/phpiredis.so' - /usr/lib64/php/5.5/modules/phpiredis.so: undefined symbol: redisReplyReaderGetError in Unknown on line 0
Could any one help?
Mac OS X 10.7.5
phpiredis: commit 1b3195f
phpize
./configure --enable-phpiredis --with-hiredis-dir=/usr/local
make
/bin/sh /Users/user/Desktop/phpiredis/libtool --mode=compile cc -I. -I/Users/user/Desktop/phpiredis -DPHP_ATOM_INC -I/Users/user/Desktop/phpiredis/include -I/Users/user/Desktop/phpiredis/main -I/Users/user/Desktop/phpiredis -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /Users/user/Desktop/phpiredis/phpiredis.c -o phpiredis.lo
cc -I. -I/Users/user/Desktop/phpiredis -DPHP_ATOM_INC -I/Users/user/Desktop/phpiredis/include -I/Users/user/Desktop/phpiredis/main -I/Users/user/Desktop/phpiredis -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /Users/user/Desktop/phpiredis/phpiredis.c -fno-common -DPIC -o .libs/phpiredis.o
/Users/user/Desktop/phpiredis/phpiredis.c:5:29: error: hiredis/hiredis.h: No such file or directory
In file included from /Users/user/Desktop/phpiredis/phpiredis.c:11:
/Users/user/Desktop/phpiredis/php_phpiredis_struct.h:4: error: expected specifier-qualifier-list before ‘redisContext’
/Users/user/Desktop/phpiredis/phpiredis.c:59: error: expected declaration specifiers or ‘...’ before ‘redisReply’
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘php_redis_connection_dtor’:
/Users/user/Desktop/phpiredis/phpiredis.c:96: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:97: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:99: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘php_redis_connection_persist’:
/Users/user/Desktop/phpiredis/phpiredis.c:110: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:110: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:111: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:113: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zm_startup_phpiredis’:
/Users/user/Desktop/phpiredis/phpiredis.c:131: error: ‘REDIS_REPLY_STRING’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:131: error: (Each undeclared identifier is reported only once
/Users/user/Desktop/phpiredis/phpiredis.c:131: error: for each function it appears in.)
/Users/user/Desktop/phpiredis/phpiredis.c:132: error: ‘REDIS_REPLY_ARRAY’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:133: error: ‘REDIS_REPLY_INTEGER’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:134: error: ‘REDIS_REPLY_NIL’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:135: error: ‘REDIS_REPLY_STATUS’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:136: error: ‘REDIS_REPLY_ERROR’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_pconnect’:
/Users/user/Desktop/phpiredis/phpiredis.c:170: error: ‘redisContext’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:170: error: ‘c’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:180: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:181: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:182: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:182: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:182: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:182: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:183: error: ‘phpiredis_connection’ has no member named ‘port’
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_reader_create’:
/Users/user/Desktop/phpiredis/phpiredis.c:201: warning: assignment makes pointer from integer without a cast
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_reader_reset’:
/Users/user/Desktop/phpiredis/phpiredis.c:310: warning: assignment makes pointer from integer without a cast
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_reader_get_reply’:
/Users/user/Desktop/phpiredis/phpiredis.c:380: error: ‘REDIS_ERR’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:382: warning: assignment makes pointer from integer without a cast
/Users/user/Desktop/phpiredis/phpiredis.c:389: error: too many arguments to function ‘convert_redis_to_php’
/Users/user/Desktop/phpiredis/phpiredis.c:392: error: ‘redisReply’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:392: error: expected expression before ‘)’ token
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_reader_get_state’:
/Users/user/Desktop/phpiredis/phpiredis.c:410: error: ‘REDIS_ERR’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:412: warning: assignment makes pointer from integer without a cast
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_connect’:
/Users/user/Desktop/phpiredis/phpiredis.c:437: error: ‘redisContext’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:437: error: ‘c’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:446: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:447: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:448: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:448: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:448: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:448: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:449: error: ‘phpiredis_connection’ has no member named ‘port’
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_disconnect’:
/Users/user/Desktop/phpiredis/phpiredis.c:456: error: ‘redisContext’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:456: error: ‘c’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:462: error: expected expression before ‘)’ token
/Users/user/Desktop/phpiredis/phpiredis.c: At top level:
/Users/user/Desktop/phpiredis/phpiredis.c:470: error: expected declaration specifiers or ‘...’ before ‘redisReply’
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘convert_redis_to_php’:
/Users/user/Desktop/phpiredis/phpiredis.c:477: error: ‘reply’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:478: error: ‘REDIS_REPLY_INTEGER’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:481: error: ‘REDIS_REPLY_ERROR’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:482: error: ‘REDIS_REPLY_STATUS’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:512: error: ‘REDIS_REPLY_STRING’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:515: error: ‘REDIS_REPLY_ARRAY’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:521: error: too many arguments to function ‘convert_redis_to_php’
/Users/user/Desktop/phpiredis/phpiredis.c:525: error: ‘REDIS_REPLY_NIL’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_multi_command’:
/Users/user/Desktop/phpiredis/phpiredis.c:537: error: ‘redisReply’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:537: error: ‘reply’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:549: error: ‘redisContext’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:549: error: expected expression before ‘)’ token
/Users/user/Desktop/phpiredis/phpiredis.c:560: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:571: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:571: error: ‘REDIS_OK’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:579: error: too many arguments to function ‘convert_redis_to_php’
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_multi_command_bs’:
/Users/user/Desktop/phpiredis/phpiredis.c:592: error: ‘redisReply’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:592: error: ‘reply’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:610: error: ‘redisContext’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:610: error: expected expression before ‘)’ token
/Users/user/Desktop/phpiredis/phpiredis.c:638: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:655: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:655: error: ‘REDIS_OK’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:663: error: too many arguments to function ‘convert_redis_to_php’
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_command’:
/Users/user/Desktop/phpiredis/phpiredis.c:720: error: ‘redisReply’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:720: error: ‘reply’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:729: error: ‘redisContext’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:729: error: expected expression before ‘)’ token
/Users/user/Desktop/phpiredis/phpiredis.c:731: error: ‘REDIS_REPLY_ERROR’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:733: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:735: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:736: error: ‘c’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:736: error: ‘phpiredis_connection’ has no member named ‘ip’
/Users/user/Desktop/phpiredis/phpiredis.c:736: error: ‘phpiredis_connection’ has no member named ‘port’
/Users/user/Desktop/phpiredis/phpiredis.c:740: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:744: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:746: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:746: error: ‘REDIS_OK’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:747: warning: format not a string literal and no format arguments
/Users/user/Desktop/phpiredis/phpiredis.c:755: error: too many arguments to function ‘convert_redis_to_php’
/Users/user/Desktop/phpiredis/phpiredis.c: In function ‘zif_phpiredis_command_bs’:
/Users/user/Desktop/phpiredis/phpiredis.c:762: error: ‘redisReply’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:762: error: ‘reply’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:776: error: ‘redisContext’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:776: error: expected expression before ‘)’ token
/Users/user/Desktop/phpiredis/phpiredis.c:814: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:821: error: ‘phpiredis_connection’ has no member named ‘c’
/Users/user/Desktop/phpiredis/phpiredis.c:821: error: ‘REDIS_OK’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:827: error: ‘REDIS_REPLY_ERROR’ undeclared (first use in this function)
/Users/user/Desktop/phpiredis/phpiredis.c:829: warning: format not a string literal and no format arguments
/Users/user/Desktop/phpiredis/phpiredis.c:833: error: too many arguments to function ‘convert_redis_to_php’
make: *** [phpiredis.lo] Error 1
[root@localhost ~/phpiredis]#make test
Build complete.
Don't forget to run 'make test'.
PHP Warning: PHP Startup: Unable to load dynamic library '/root/phpiredis/modules/phpiredis.so' - /root/phpiredis/modules/phpiredis.so: undefined symbol: redisReplyReaderGetReply in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/root/phpiredis/modules/phpiredis.so' - /root/phpiredis/modules/phpiredis.so: undefined symbol: redisReplyReaderGetReply in Unknown on line 0
=====================================================================
PHP : /usr/bin/php
Warning: PHP Startup: Unable to load dynamic library '/root/phpiredis/modules/phpiredis.so' - /root/phpiredis/modules/phpiredis.so: undefined symbol: redisReplyReaderGetReply in Unknown on line 0
PHP_SAPI : cli
PHP_VERSION : 5.6.40
ZEND_VERSION: 2.6.0
PHP_OS : Linux - Linux localhost.localdomain 2.6.32-754.12.1.el6.x86_64 #1 SMP Tue Apr 9 14:52:26 UTC 2019 x86_64
INI actual : /root/phpiredis/tmp-php.ini
More .INIs :
CWD : /root/phpiredis
Extra dirs :
VALGRIND : Not used
[root@localhost /data/wwwroot/code/_example/app]#php index.php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/phpiredis.so' - /usr/lib64/php/modules/phpiredis.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Fatal error: Call to undefined function phpiredis_connect() in /data/wwwroot/code/library/includes/class/memcachedb.php on line 75
All previous versions worked fine. Arch recently upgraded hiredis to 0.14.0-1. I built it for armv6 against php 7.4.3 and hiredis 0.14.0-1 and I can load and run the extension
phpinfo()
PHP Version => 7.4.2
System => Linux runeaudio 4.19.102-1-ARCH #1 SMP PREEMPT Thu Feb 13 22:13:34 CST 2020 armv6l
Build Date => Jan 21 2020 19:19:29
...
phpiredis
phpiredis => enabled
phpiredis version => 1.0.0
hiredis version => 0.14.0
When I build it for armv7h, I get an error:
PHP Warning: PHP Startup: Unable to load dynamic library 'phpiredis' (tried: /usr/lib/php/modules/phpiredis (/usr/lib/php/modules/phpiredis: cannot open shared object file: No such file or directory), /usr/lib/php/modules/phpiredis.so (/usr/lib/php/modules/phpiredis.so: undefined symbol: redisReplyReaderGetError)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'phpiredis' (tried: /usr/lib/php/modules/phpiredis (/usr/lib/php/modules/phpiredis: cannot open shared object file: No such file or directory), /usr/lib/php/modules/phpiredis.so (/usr/lib/php/modules/phpiredis.so: undefined symbol: redisReplyReaderGetError)) in Unknown on line 0
phpinfo()
PHP Version => 7.4.2
System => Linux livingrune 4.19.102-1-ARCH #1 SMP PREEMPT Sun Feb 9 19:07:08 UTC 2020 armv7l
Build Date => Jan 21 2020 19:19:33
If I revert the hiredis version to 0.13.3-2 (on both the build machine and the running machine) and re-build the extension, I get no error
Both the build machine and the machine I am using it on are 'up to date' with packages. I did a pacman -Syu on both machines and re-built the extension
phpinfo()
PHP Version => 7.4.2
System => Linux livingrune 4.19.102-1-ARCH #1 SMP PREEMPT Sun Feb 9 19:07:08 UTC 2020 armv7l
Build Date => Jan 21 2020 19:19:33
...
phpiredis
phpiredis => enabled
phpiredis version => 1.0.0
hiredis version => 0.13.3
Both the armv6h and armv7h kernel and hiredis extension are built using the same PKGBUILD file.
Proposal 1
Rational: when installed (from package or from pecl), this documentation is no more needed (so doesn't need to be tagged as role="doc" in package.xml, role="src" is enough)
Proposal 2
Document the different way to install
Installation from sources (current content)
Installation from pecl: pecl install phpiredis
Binary Installation, as lot of people prefer to rely on this method when possible
Windows users can use the "DLL" link from the pecl page (if supported, as I don't see the config.w32 for now)
Fedora users can use the php-phpiredis (https://apps.fedoraproject.org/packages/php-phpiredis) from official repository and: dnf install php-phpiredis
RHEL / CentOS users can use the php-phpiredis package from EPEL repository (https://fedoraproject.org/wiki/EPEL): yum install php-phpiredis
Other distributions can be added later on maintainer/user request.
Of course, we have to wait for pecl approval. For discussion (and I can open a PR... even if my English is probably not the better)
I am testing the behavior of phpiredis when the connection to the server is unstable. Sadly, phpiredis' reaction in that case is basically the worst possible: it creates a segfault and kills the entire php process.
Code to reproduce:
<?php
$r = phpiredis_connect('localhost', 6379);
$res = phpiredis_command_bs($r, ['BLPOP', 'blocking_key', '30']);
print_r($res);
I am running this code from the console using PHP 5.5.4. If I kill the redis server while phpiredis is blocking and waiting for a response, it generates the segfault.
I will try to investigate a bit, but if someone else has an idea, please share it!
phpiredis.c:36:32: error: unknown type name ‘zend_rsrc_list_entry’
php -v
PHP 7.0.3-13+deb.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.4.0RC4, Copyright (c) 2002-2016, by Derick Rethans
with blackfire v1.9.2, https://blackfire.io, by Blackfireio Inc.
Hello,
When running the following script with PHP compiled with the debug option (for example by installing it with brew install php54 --enable-debug
), I got a memory leak detection by zend engine :
$reader = phpiredis_reader_create();
phpiredis_reader_set_status_handler($reader, function(){});
phpiredis_reader_set_error_handler($reader, function(){});
phpiredis_reader_destroy($reader);
outputs :
[Fri Dec 28 13:05:29 2012] Script: '/Users/romain/Documents/workspace/GloubsterServer/testleak.php'
Zend/zend_vm_execute.h(6804) : Freeing 0x1042F46A0 (32 bytes), script=/Users/romain/Documents/workspace/GloubsterServer/testleak.php
Last leak repeated 1 time
[Fri Dec 28 13:05:29 2012] Script: '/Users/romain/Documents/workspace/GloubsterServer/testleak.php'
/private/tmp/php54-WbUP/php-5.4.10/Zend/zend_API.c(3078) : Freeing 0x1042F71C0 (18 bytes), script=/Users/romain/Documents/workspace/GloubsterServer/testleak.php
Last leak repeated 1 time
[Fri Dec 28 13:05:29 2012] Script: '/Users/romain/Documents/workspace/GloubsterServer/testleak.php'
/usr/local/src/phpiredis/phpiredis.c(194) : Freeing 0x1042F7D30 (40 bytes), script=/Users/romain/Documents/workspace/GloubsterServer/testleak.php
=== Total 5 memory leaks detected ===
Has anyone got this working for snc_redis for symfony 2/3?
I try:
$ git clone https://github.com/nrk/phpiredis.git
$ cd phpiredis
$ phpize && ./configure --enable-phpiredis
$ make && make install
make: *** No targets specified and no makefile found. Stop.
OS
Ubuntu 14.04 Linux 3.13.0-39-generic x86_64
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
PHP 5.5.9-1ubuntu4.5
INFO
$ ./configure --enable-phpiredis
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -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
checking for PHP extension directory... /usr/lib/php5/20121212
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking whether to enable phpiredis support... yes, shared
checking for hiredis library... yes, shared
checking for hiredis installation... configure: error: not found
checking for hiredis installation... configure: error: not found
First, thank you for all of your hard work.
Thread moved from predis/predis#410
Here is my setup:
ubuntu@ip-10-2-12-205:~$ php -v
PHP 7.0.14-2+deb.sury.org~xenial+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.14-2+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies
with blackfire v1.14.2~linux-x64-non_zts70, https://blackfire.io, by Blackfireio Inc.
Client
$conf['redis_servers'] = [
[
'scheme' => 'tcp',
'host' => 'hostname-of-master-1,
'port' => 6379,
'timeout' => 30,
],
[
'scheme' => 'tcp',
'host' => 'hostname-of-master-2,
'port' => 6379,
'timeout' => 30,
],
[
'scheme' => 'tcp',
'host' => 'host-name-of-master-3',
'port' => 6379,
'timeout' => 30,
]
];
$conf['redis_options'] = [
'cluster' => 'redis',
'connections' => [
'tcp' => 'Predis\Connection\PhpiredisStreamConnection',
'unix' => 'Predis\Connection\PhpiredisSocketConnection',
],
];
"Warning: phpiredis_reader_get_state(): supplied resource is not a valid phpredis reader resource in Predis\\Connection\\PhpiredisStreamConnection->read() (line 200 of composer/vendor/predis/predis/src/Connection/PhpiredisStreamConnection.php
The error occurs inconsistently. I've seen it mostly in hgetal
l which is also the most common call
connections
does remove the errortrigger_errors
to false
in client options and the error still occursAdding a bit more information, it phpiredis was also crashing the php-fpm processes even with commenting out the "connections". Once I disabled the extension, I was able to keep the php-fpm processes running. I'm happy to move this issue over to the other project if you feel that is best.
/* 'connections' => [
'tcp' => 'Predis\Connection\PhpiredisStreamConnection',
'unix' => 'Predis\Connection\PhpiredisSocketConnection',
],*/
Please consider making your code available through PECL.
Thank you.
can't use at php7 now . pls support it. thanks ! 👍
phpiredis_command_bs($redis, ['SET', 'test', '111']) is ok,
But if phpiredis_command_bs($redis, ['SET', 'test', 111])
My php is 502 Bad Gateway.
The log is:
729 Sep 7 16:20:24 bogon kernel: php-fpm[18478]: segfault at 736964 ip 004142b1 sp bffcbfcc error 4 in libc-2.12.so[399000+190000]
730 Sep 7 16:20:24 bogon abrtd: Directory 'ccpp-2015-09-07-16:20:24-18478' creation detected
731 Sep 7 16:20:24 bogon abrt[18663]: Saved core dump of pid 18478 (/usr/local/php/sbin/php-fpm) to /var/spool/abrt/ccpp-2015-09-07-16:20:24-18478 (150065152 bytes)
732 Sep 7 16:20:25 bogon abrtd: Executable '/usr/local/php/sbin/php-fpm' doesn't belong to any package and ProcessUnpackaged is set to 'no'
733 Sep 7 16:20:25 bogon abrtd: 'post-create' on '/var/spool/abrt/ccpp-2015-09-07-16:20:24-18478' exited with 1
734 Sep 7 16:20:25 bogon abrtd: Deleting problem directory '/var/spool/abrt/ccpp-2015-09-07-16:20:24-18478
THX!
It took more than an year since #39 by @Danack but I finally had the time to sit down and work on polishing his initial contribution and put an end to the wait: phpiredis can be built and used on PHP 7.0, you can find the code on the php7
branch. The test suite is green on all the supported PHP versions and even the test suite of Predis (which has some connection backends that use the reader resource exposed by phpiredis) looks good. I'd like to test this branch a bit more before merging it into master
and I'd also like to have some feedback from others so please try the new code and comment on this issue if you find any bug or memory leak using the extension on both PHP 5.x and 7.0.
PS: please note that for now phpiredis depends on hiredis up to v0.13 and it doesn't build with hiredis v1.0.0 which is still unreleased and a work-in-progress.
Thanks for the wait!
I couldn't figure out why I was failing 10/25 tests. They were all related to connection so I took a shot in the dark and tried the tests again with the default redis-server running. 25/25 passed!
Could you please include instructions to run redis-server on port 6379 before running make test
?
Hello,
are there any plans to support Alpine Linux? I really want to use this to increase performance and don't want to use Ubuntu/Debian images. The problem:
When installing hiredis-dev and phpiredis doing the following within my Dockerfile:
FROM php:7.3-fpm-alpine
RUN apk --update add \
alpine-sdk \
openssl-dev \
php7-pear \
php7-dev \
supervisor \
hiredis-dev \
&& rm -rf /var/cache/apk/*
RUN pecl channel-update pecl.php.net \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& git clone https://github.com/nrk/phpiredis.git \
&& ( \
cd phpiredis \
&& git checkout v1.0.0 \
&& phpize \
&& ./configure --enable-phpiredis \
&& make \
&& make install \
) \
&& rm -r phpiredis \
&& docker-php-ext-enable phpiredis
... I receive the error, that phpiredis couldn't be loaded:
docker run -it mycompany/php:latest php -i | grep redis
PHP Warning: PHP Startup: Unable to load dynamic library 'phpiredis.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20180731/phpiredis.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20180731/phpiredis.so: redisReplyReaderGetReply: symbol not found), /usr/local/lib/php/extensions/no-debug-non-zts-20180731/phpiredis.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20180731/phpiredis.so.so: No such file or directory)) in Unknown on line 0
/usr/local/etc/php/conf.d/docker-php-ext-phpiredis.ini,
/usr/local/etc/php/conf.d/docker-php-ext-redis.ini,
Hi,
I'm using Webuzo on Centos. The php path is /usr/local/apps/php54/bin/php
and Hiredis is in /usr/local/hiredis/
. The script wasn't able to find hiredis installation. I tried
/usr/local/apps/php54/bin/phpize && ./configure --enable-phpiredis --with-hiredis-dir=/usr/local --with-php-config=/usr/local/apps/php54/bin/php-config
but it's still showing checking for hiredis installation... configure: error: not found
Here's the log:
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
......................
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/apps/php54
checking for PHP includes... -I/usr/local/apps/php54/include/php -I/usr/local/apps/php54/include/php/main -I/usr/local/apps/php54/include/php/TSRM -I/usr/local/apps/php54/include/php/Zend -I/usr/local/apps/php54/include/php/ext -I/usr/local/apps/php54/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/apps/php54/lib/extensions/no-debug-non-zts-20100525
checking for PHP installed headers prefix... /usr/local/apps/php54/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable phpiredis support... yes, shared
checking for hiredis library... yes, shared
checking for hiredis installation... configure: error: not found //**************
We are using phpiredis on a high-traffic site and are quite impressed with its performance and ease of use. One thing thats missing though is proper error handling. Currently, when the server replies with an error message (for example when a command is issued against a key of the wrong type), phpiredis will raise a PHP error, which must be handled by the user application.
Unfortunately PHP does not offer any form of classification for errors, all errors must be handled by the same error handler function. This makes it very hard to properly encapsulate the Redis functionality.
We would like to handle the errors coming out of phpiredis separately from other errors that may be happening elsewhere. I can think of three possible strategies for that, all of which don't raise PHP errors:
phpiredis_last_error()
. This special return value could be either false
or null
. As these values can also be valid return values, the user application, upon seeing the value, should call the error accessor and determine whether an error really occurred. (This is how phpredis does it)false
.
phpiredis_reader
from PHP code, and a function to set an error handler on a reader also exists. I could however not find a way of telling phpredis_command_bs()
for example, to use this specific reader. Is there a way of doing this? It seems like these readers are never used.I am willing to implement the option that is decided on, and provide it via a pull request. However, I wanted to first open an issue to provide the possibility for a discussion.
Hi,
I have created a PR on the Homebrew's PHP repository (https://github.com/Homebrew/homebrew-php/pull/1312).
The only requirement is to tag a release for the Homebrew Formula to not to point to the HEAD of the extension.
Can you tag a release?
Thanks in advance!
Christian.
I get the following error:
dyld: lazy symbol binding failed: Symbol not found: _redisReaderCreate
Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20100525/phpiredis.so
Expected in: flat namespace
dyld: Symbol not found: _redisReaderCreate
Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20100525/phpiredis.so
Expected in: flat namespace
Trace/BPT trap: 5
I'm guessing the C API changed and phpiredis is not updated to it yet. If you have any solutions, that would be awesome.
PHP Startup: Unable to load dynamic library 'phpiredis.so' - phpiredis.so: undefined symbol: Z_ADDREF_PP in Unknown on line 0
PHP_VERSION : 5.2.10
ZEND_VERSION: 2.2.0
PHP_OS: Linux - Linux 2.6.18-194.11.1.el5xen #1 SMP Tue Aug 10 19:41:55 EDT 2010 x86_64
I have been successful in building one of the other redis php extensions, if that helps.
When I'm using persistent connection from time to time (it's totally random) HMSET returns false
instead of OK
message even for same commends and arguments.
hmset:
resource(31, phpredis connection persistent)
array (size=12)
0 => string 'HMSET' (length=5)
1 => string 'zone:tablet:641' (length=15)
2 => string 'product' (length=7)
3 => string 'pd' (length=2)
4 => string 'queue' (length=5)
5 => string '10907' (length=5)
6 => string 'fviews' (length=6)
7 => string '0' (length=1)
8 => string 'ftime' (length=5)
9 => string '0' (length=1)
10 => string 'subdomain' (length=9)
11 => string 'ads' (length=3)
string 'OK' (length=2)
hmset:
resource(31, phpredis connection persistent)
array (size=12)
0 => string 'HMSET' (length=5)
1 => string 'zone:tablet:641' (length=15)
2 => string 'product' (length=7)
3 => string 'pd' (length=2)
4 => string 'queue' (length=5)
5 => string '10907' (length=5)
6 => string 'fviews' (length=6)
7 => string '0' (length=1)
8 => string 'ftime' (length=5)
9 => string '0' (length=1)
10 => string 'subdomain' (length=9)
11 => string 'ads' (length=3)
boolean false
Any idea why is this happening ?
Specs:
fyi and just in case through serendipity you pick this weekend to do it, I've done most of the work to support PHP 7 in this extension: https://github.com/Danack/phpiredis
However it seems to be triggering a bug in PHP core, which I'll have to investigate.
After successfully installed phpiredis following this README, I got this issue info running make test:
`luliang@luliang-VirtualBox:/media/sf_theddrive/opensource/phpiredis/phpiredis-master$ make test
Build complete.
Don't forget to run 'make test'.
PHP Warning: PHP Startup: Unable to load dynamic library '/media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so' - /media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so: undefined symbol: redisReplyReaderGetError in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so' - /media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so: undefined symbol: redisReplyReaderGetError in Unknown on line 0
PHP : /usr/bin/php
Warning: PHP Startup: Unable to load dynamic library '/media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so' - /media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so: undefined symbol: redisReplyReaderGetError in Unknown on line 0
PHP_SAPI : cli
PHP_VERSION : 5.5.9-1ubuntu4.17
ZEND_VERSION: 2.5.0
PHP_OS : Linux - Linux luliang-VirtualBox 3.19.0-59-generic #66~14.04.1-Ubuntu SMP Fri May 13 17:27:10 UTC 2016 x86_64
INI actual : /media/sf_theddrive/opensource/phpiredis/phpiredis-master/tmp-php.ini
More .INIs :
CWD : /media/sf_theddrive/opensource/phpiredis/phpiredis-master
Extra dirs :
SKIP [CLIENT] Connect to Redis [tests/client_001.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Persistent and non-persistent connections [tests/client_002.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Persistent and non-persistent connections (UNIX socket) [tests/client_003.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute commands [tests/client_004.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute pipelined commands [tests/client_005.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute pipelined commands returning nested multibulk responses [tests/client_006.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute commands (binary-safe) [tests/client_007.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute commands with binary data (binary-safe) [tests/client_008.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute pipelined commands (binary safe) [tests/client_009.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Do not attempt to reconnect upon disconnection [tests/client_010.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Do not attempt to reconnect upon disconnection (pipeline) [tests/client_011.phpt] reason: phpiredis extension is not available
SKIP [READER] Create reader resource [tests/reader_001.phpt] reason: phpiredis extension is not available
SKIP [READER] Feed reader and parse responses [tests/reader_002.phpt] reason: phpiredis extension is not available
SKIP [READER] Check reader state [tests/reader_003.phpt] reason: phpiredis extension is not available
SKIP [READER] Reset reader [tests/reader_004.phpt] reason: phpiredis extension is not available
SKIP [READER] Response types [tests/reader_005.phpt] reason: phpiredis extension is not available
SKIP [READER] Set custom error handler [tests/reader_006.phpt] reason: phpiredis extension is not available
SKIP [READER] Set custom status handler [tests/reader_007.phpt] reason: phpiredis extension is not available
SKIP [READER] Custom error handler throwing exceptions or returning objects [tests/reader_008.phpt] reason: phpiredis extension is not available
SKIP [READER] Properly handle NULL responses [tests/reader_009.phpt] reason: phpiredis extension is not available
SKIP [READER] Keep multibulk responses types [tests/reader_010.phpt] reason: phpiredis extension is not available
SKIP [READER] Test regression for segfaults [tests/reader_011.phpt] reason: phpiredis extension is not available
SKIP [READER] Parameters formatting should not modify input argument. [tests/reader_012.phpt] reason: phpiredis extension is not available
SKIP [READER] Parameters formatting should not break on many arguments [tests/reader_013.phpt] reason: phpiredis extension is not available
SKIP [SERIALIZER] Command serialization [tests/serializer_001.phpt] reason: phpiredis extension is not available
TIME END 2016-06-03 03:29:14
Exts skipped : 0
Number of tests : 26 0
Tests skipped : 26 (100.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 0 ( 0.0%) ( 0.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
`
Building from source, we get:
/bin/bash /var/tmp/php-iredis-1.0.0/libtool --mode=compile cc -I. -I/var/tmp/php-iredis-1.0.0 -DPHP_ATOM_INC -I/var/tmp/php-iredis-1.0.0/include -I/var/tmp/php-iredis-1.0.0/main -I/var/tmp/php-iredis-1.0.0 -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 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/php-iredis-1.0.0/phpiredis.c -o phpiredis.lo
libtool: compile: cc -I. -I/var/tmp/php-iredis-1.0.0 -DPHP_ATOM_INC -I/var/tmp/php-iredis-1.0.0/include -I/var/tmp/php-iredis-1.0.0/main -I/var/tmp/php-iredis-1.0.0 -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 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/php-iredis-1.0.0/phpiredis.c -fPIC -DPIC -o .libs/phpiredis.o
/var/tmp/php-iredis-1.0.0/phpiredis.c: In function 'zif_phpiredis_multi_command':
/var/tmp/php-iredis-1.0.0/phpiredis.c:224:9: warning: passing argument 2 of 'redisGetReply' from incompatible pointer type [enabled by default]
In file included from /var/tmp/php-iredis-1.0.0/phpiredis.c:1:0:
/usr/include/hiredis/hiredis.h:194:5: note: expected 'void **' but argument is of type 'struct redisReply **'
/var/tmp/php-iredis-1.0.0/phpiredis.c: In function 'zif_phpiredis_multi_command_bs':
/var/tmp/php-iredis-1.0.0/phpiredis.c:294:9: warning: passing argument 3 of 'redisAppendCommandArgv' from incompatible pointer type [enabled by default]
In file included from /var/tmp/php-iredis-1.0.0/phpiredis.c:1:0:
/usr/include/hiredis/hiredis.h:205:5: note: expected 'const char **' but argument is of type 'char **'
/var/tmp/php-iredis-1.0.0/phpiredis.c:313:9: warning: passing argument 2 of 'redisGetReply' from incompatible pointer type [enabled by default]
In file included from /var/tmp/php-iredis-1.0.0/phpiredis.c:1:0:
/usr/include/hiredis/hiredis.h:194:5: note: expected 'void **' but argument is of type 'struct redisReply **'
/var/tmp/php-iredis-1.0.0/phpiredis.c: In function 'zif_phpiredis_command_bs':
/var/tmp/php-iredis-1.0.0/phpiredis.c:420:5: warning: passing argument 3 of 'redisAppendCommandArgv' from incompatible pointer type [enabled by default]
In file included from /var/tmp/php-iredis-1.0.0/phpiredis.c:1:0:
/usr/include/hiredis/hiredis.h:205:5: note: expected 'const char **' but argument is of type 'char **'
/var/tmp/php-iredis-1.0.0/phpiredis.c:428:5: warning: passing argument 2 of 'redisGetReply' from incompatible pointer type [enabled by default]
In file included from /var/tmp/php-iredis-1.0.0/phpiredis.c:1:0:
/usr/include/hiredis/hiredis.h:194:5: note: expected 'void **' but argument is of type 'struct redisReply **'
/var/tmp/php-iredis-1.0.0/phpiredis.c: In function 'zif_phpiredis_format_command':
/var/tmp/php-iredis-1.0.0/phpiredis.c:487:5: warning: passing argument 3 of 'redisFormatCommandArgv' from incompatible pointer type [enabled by default]
In file included from /var/tmp/php-iredis-1.0.0/phpiredis.c:1:0:
/usr/include/hiredis/hiredis.h:163:5: note: expected 'const char **' but argument is of type 'char **'
/bin/bash /var/tmp/php-iredis-1.0.0/libtool --mode=link cc -DPHP_ATOM_INC -I/var/tmp/php-iredis-1.0.0/include -I/var/tmp/php-iredis-1.0.0/main -I/var/tmp/php-iredis-1.0.0 -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 -DHAVE_CONFIG_H -g -O2 -o phpiredis.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/php-iredis-1.0.0/modules phpiredis.lo -lhiredis
libtool: link: cc -shared -fPIC -DPIC .libs/phpiredis.o -lhiredis -O2 -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 /var/tmp/php-iredis-1.0.0/libtool --mode=install cp ./phpiredis.la /var/tmp/php-iredis-1.0.0/modules
libtool: install: cp ./.libs/phpiredis.so /var/tmp/php-iredis-1.0.0/modules/phpiredis.so
libtool: install: cp ./.libs/phpiredis.lai /var/tmp/php-iredis-1.0.0/modules/phpiredis.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /var/tmp/php-iredis-1.0.0/modules
hiredis is latest master. Are these warning harmless?
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /opt/local
checking for PHP includes... -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib
checking for PHP extension directory... /opt/local/lib/php/extensions/no-debug-non-zts-20131226
checking for PHP installed headers prefix... /opt/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable phpiredis support... yes, shared
checking for hiredis library... yes, shared
checking for hiredis installation... found in /opt/local
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
/bin/bash /tmp/phpiredis/libtool --mode=compile cc -I. -I/tmp/phpiredis -DPHP_ATOM_INC -I/tmp/phpiredis/include -I/tmp/phpiredis/main -I/tmp/phpiredis -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib -I/opt/local/include -DHAVE_CONFIG_H -g -O2 -c /tmp/phpiredis/phpiredis.c -o phpiredis.lo
mkdir .libs
cc -I. -I/tmp/phpiredis -DPHP_ATOM_INC -I/tmp/phpiredis/include -I/tmp/phpiredis/main -I/tmp/phpiredis -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib -I/opt/local/include -DHAVE_CONFIG_H -g -O2 -c /tmp/phpiredis/phpiredis.c -fPIC -DPIC -o .libs/phpiredis.o
/opt/local/include/hiredis/hiredis.h:158:7: error: expected identifier or '(' before numeric constant
} unix;
^
In file included from /tmp/phpiredis/phpiredis.c:1:0:
/opt/local/include/hiredis/hiredis.h:160:1: warning: no semicolon at end of struct or union [enabled by default]
} redisContext;
^
/tmp/phpiredis/phpiredis.c: In function 'zif_phpiredis_multi_command':
/tmp/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 /tmp/phpiredis/phpiredis.c:1:0:
/opt/local/include/hiredis/hiredis.h:196:5: note: expected 'void *' but argument is of type 'struct redisReply *'
int redisGetReply(redisContext c, void *reply);
^
/tmp/phpiredis/phpiredis.c: In function 'zif_phpiredis_multi_command_bs':
/tmp/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 /tmp/phpiredis/phpiredis.c:1:0:
/opt/local/include/hiredis/hiredis.h:207:5: note: expected 'const char *' but argument is of type 'char *'
int redisAppendCommandArgv(redisContext c, int argc, const char *argv, const size_t argvlen);
^
/tmp/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 /tmp/phpiredis/phpiredis.c:1:0:
/opt/local/include/hiredis/hiredis.h:196:5: note: expected 'void *' but argument is of type 'struct redisReply *'
int redisGetReply(redisContext *c, void *reply);
^
/tmp/phpiredis/phpiredis.c: In function 'zif_phpiredis_command':
/tmp/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);
^
/tmp/phpiredis/phpiredis.c: In function 'zif_phpiredis_command_bs':
/tmp/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 /tmp/phpiredis/phpiredis.c:1:0:
/opt/local/include/hiredis/hiredis.h:207:5: note: expected 'const char *' but argument is of type 'char *'
int redisAppendCommandArgv(redisContext *c, int argc, const char *argv, const size_t argvlen);
^
/tmp/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 /tmp/phpiredis/phpiredis.c:1:0:
/opt/local/include/hiredis/hiredis.h:196:5: note: expected 'void *' but argument is of type 'struct redisReply *'
int redisGetReply(redisContext *c, void *reply);
^
/tmp/phpiredis/phpiredis.c: In function 'zif_phpiredis_format_command':
/tmp/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 /tmp/phpiredis/phpiredis.c:1:0:
/opt/local/include/hiredis/hiredis.h:128:5: note: expected 'const char *' but argument is of type 'char *'
int redisFormatCommandArgv(char *_target, int argc, const char *_argv, const size_t argvlen);
^
make: ** [phpiredis.lo] Error 1
After successfully installed phpiredis following this README, I got this issue info running make test:
luliang@luliang-VirtualBox:/media/sf_theddrive/opensource/phpiredis/phpiredis-master$ make test
Build complete.
Don't forget to run 'make test'.PHP Warning: PHP Startup: Unable to load dynamic library '/media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so' - /media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so: undefined symbol: redisReplyReaderGetError in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so' - /media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so: undefined symbol: redisReplyReaderGetError in Unknown on line 0PHP : /usr/bin/php
Warning: PHP Startup: Unable to load dynamic library '/media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so' - /media/sf_theddrive/opensource/phpiredis/phpiredis-master/modules/phpiredis.so: undefined symbol: redisReplyReaderGetError in Unknown on line 0PHP_SAPI : cli
PHP_VERSION : 5.5.9-1ubuntu4.17
ZEND_VERSION: 2.5.0
PHP_OS : Linux - Linux luliang-VirtualBox 3.19.0-59-generic #66~14.04.1-Ubuntu SMP Fri May 13 17:27:10 UTC 2016 x86_64
INI actual : /media/sf_theddrive/opensource/phpiredis/phpiredis-master/tmp-php.ini
More .INIs :
CWD : /media/sf_theddrive/opensource/phpiredis/phpiredis-master
Extra dirs :
VALGRIND : Not usedTIME START 2016-06-03 03:29:13
SKIP [CLIENT] Connect to Redis [tests/client_001.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Persistent and non-persistent connections [tests/client_002.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Persistent and non-persistent connections (UNIX socket) [tests/client_003.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute commands [tests/client_004.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute pipelined commands [tests/client_005.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute pipelined commands returning nested multibulk responses [tests/client_006.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute commands (binary-safe) [tests/client_007.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute commands with binary data (binary-safe) [tests/client_008.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Execute pipelined commands (binary safe) [tests/client_009.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Do not attempt to reconnect upon disconnection [tests/client_010.phpt] reason: phpiredis extension is not available
SKIP [CLIENT] Do not attempt to reconnect upon disconnection (pipeline) [tests/client_011.phpt] reason: phpiredis extension is not available
SKIP [READER] Create reader resource [tests/reader_001.phpt] reason: phpiredis extension is not available
SKIP [READER] Feed reader and parse responses [tests/reader_002.phpt] reason: phpiredis extension is not available
SKIP [READER] Check reader state [tests/reader_003.phpt] reason: phpiredis extension is not available
SKIP [READER] Reset reader [tests/reader_004.phpt] reason: phpiredis extension is not available
SKIP [READER] Response types [tests/reader_005.phpt] reason: phpiredis extension is not available
SKIP [READER] Set custom error handler [tests/reader_006.phpt] reason: phpiredis extension is not available
SKIP [READER] Set custom status handler [tests/reader_007.phpt] reason: phpiredis extension is not available
SKIP [READER] Custom error handler throwing exceptions or returning objects [tests/reader_008.phpt] reason: phpiredis extension is not available
SKIP [READER] Properly handle NULL responses [tests/reader_009.phpt] reason: phpiredis extension is not available
SKIP [READER] Keep multibulk responses types [tests/reader_010.phpt] reason: phpiredis extension is not available
SKIP [READER] Test regression for segfaults [tests/reader_011.phpt] reason: phpiredis extension is not available
SKIP [READER] Parameters formatting should not modify input argument. [tests/reader_012.phpt] reason: phpiredis extension is not available
SKIP [READER] Parameters formatting should not break on many arguments [tests/reader_013.phpt] reason: phpiredis extension is not available
SKIP [SERIALIZER] Command serialization [tests/serializer_001.phpt] reason: phpiredis extension is not available
SKIP [SERIALIZER] Command serialization with non-string arguments [tests/serializer_002.phpt] reason: phpiredis extension is not availableTIME END 2016-06-03 03:29:14
TEST RESULT SUMMARY
Exts skipped : 0
Exts tested : 42Number of tests : 26 0
Tests skipped : 26 (100.0%)
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 0 ( 0.0%) ( 0.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 0 ( 0.0%) ( 0.0%)Time taken : 1 seconds
Hi @nrk,
I've seen that you have closed issues #46 (comment), #60 (comment) and #61 (comment).
Do you have any plan to release a 1.1.x
version?
Thanks for your work.
Andrea
Hi there,
guys, I can't run the following command because the " is not
understand as delimiter for the 3. parameter.
phpphpiredis_command($redis, 'SET user "Foo bar"');
Did I miss something?
Cheers
Hi,
I use your library to complement Predis.
This bug occurs only on a Linux 64-bit
When i use the hmset function :
$client->hmset(1,"truc",2, "chose", 4, 'haaaaa', 1);
I've got this error :
*** glibc detected *** php: free(): invalid next size (fast): 0x00000000010ea720 ***
======= Backtrace: =========
/lib64/libc.so.6[0x38e227245f]
/lib64/libc.so.6(cfree+0x4b)[0x38e22728bb]
/usr/lib64/extensions/no-debug-non-zts-20090626/phpiredis.so(zif_phpiredis_format_command+0x288)[0x7fb6a2434a58]
php[0x7fdbcc]
php[0x7feaad]
php(execute+0x3b4)[0x7fcca3]
php(zend_call_function+0xe25)[0x7bd98a]
php(zend_call_method+0x3bd)[0x7e8cb5]
php(zend_std_call_user_call+0x205)[0x7f78d8]
php[0x7fdbcc]
php[0x7feaad]
php(execute+0x3b4)[0x7fcca3]
php(zend_execute_scripts+0x249)[0x7cdb58]
php(php_execute_script+0x3a3)[0x756819]
php[0x8b509c]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x38e221d994]
php[0x4212f9]
======= Memory map: ========
00400000-00b8a000 r-xp 00000000 09:01 100623 /usr/local/bin/php
00d89000-00def000 rw-p 00789000 09:01 100623 /usr/local/bin/php
00def000-0110b000 rw-p 00000000 00:00 0 [heap]
3652c00000-3652c07000 r-xp 00000000 09:01 417794 /lib64/librt-2.5.so
3652c07000-3652e07000 ---p 00007000 09:01 417794 /lib64/librt-2.5.so
3652e07000-3652e08000 r--p 00007000 09:01 417794 /lib64/librt-2.5.so
3652e08000-3652e09000 rw-p 00008000 09:01 417794 /lib64/librt-2.5.so
38e1e00000-38e1e1c000 r-xp 00000000 09:01 418098 /lib64/ld-2.5.so
38e201c000-38e201d000 r--p 0001c000 09:01 418098 /lib64/ld-2.5.so
38e201d000-38e201e000 rw-p 0001d000 09:01 418098 /lib64/ld-2.5.so
38e2200000-38e234e000 r-xp 00000000 09:01 418099 /lib64/libc-2.5.so
38e234e000-38e254e000 ---p 0014e000 09:01 418099 /lib64/libc-2.5.so
38e254e000-38e2552000 r--p 0014e000 09:01 418099 /lib64/libc-2.5.so
38e2552000-38e2553000 rw-p 00152000 09:01 418099 /lib64/libc-2.5.so
38e2553000-38e2558000 rw-p 00000000 00:00 0
38e2600000-38e2602000 r-xp 00000000 09:01 418100 /lib64/libdl-2.5.so
38e2602000-38e2802000 ---p 00002000 09:01 418100 /lib64/libdl-2.5.so
38e2802000-38e2803000 r--p 00002000 09:01 418100 /lib64/libdl-2.5.so
38e2803000-38e2804000 rw-p 00003000 09:01 418100 /lib64/libdl-2.5.so
38e2a00000-38e2b33000 r-xp 00000000 09:01 125653 /usr/lib64/libxml2.so.2.6.26
38e2b33000-38e2d33000 ---p 00133000 09:01 125653 /usr/lib64/libxml2.so.2.6.26
38e2d33000-38e2d3c000 rw-p 00133000 09:01 125653 /usr/lib64/libxml2.so.2.6.26
38e2d3c000-38e2d3d000 rw-p 00000000 00:00 0
38e2e00000-38e2e3b000 r-xp 00000000 09:01 418109 /lib64/libsepol.so.1
38e2e3b000-38e303b000 ---p 0003b000 09:01 418109 /lib64/libsepol.so.1
38e303b000-38e303c000 rw-p 0003b000 09:01 418109 /lib64/libsepol.so.1
38e303c000-38e3046000 rw-p 00000000 00:00 0
38e3200000-38e3282000 r-xp 00000000 09:01 418108 /lib64/libm-2.5.so
38e3282000-38e3481000 ---p 00082000 09:01 418108 /lib64/libm-2.5.so
38e3481000-38e3482000 r--p 00081000 09:01 418108 /lib64/libm-2.5.so
38e3482000-38e3483000 rw-p 00082000 09:01 418108 /lib64/libm-2.5.so
38e3600000-38e3615000 r-xp 00000000 09:01 418110 /lib64/libselinux.so.1
38e3615000-38e3815000 ---p 00015000 09:01 418110 /lib64/libselinux.so.1
38e3815000-38e3817000 rw-p 00015000 09:01 418110 /lib64/libselinux.so.1
38e3817000-38e3818000 rw-p 00000000 00:00 0
38e3a00000-38e3a14000 r-xp 00000000 09:01 417838 /lib64/libz.so.1.2.3
38e3a14000-38e3c13000 ---p 00014000 09:01 417838 /lib64/libz.so.1.2.3
38e3c13000-38e3c14000 rw-p 00013000 09:01 417838 /lib64/libz.so.1.2.3
38e4200000-38e4209000 r-xp 00000000 09:01 418111 /lib64/libcrypt-2.5.so
38e4209000-38e4408000 ---p 00009000 09:01 418111 /lib64/libcrypt-2.5.so
38e4408000-38e4409000 r--p 00008000 09:01 418111 /lib64/libcrypt-2.5.so
38e4409000-38e440a000 rw-p 00009000 09:01 418111 /lib64/libcrypt-2.5.so
38e440a000-38e4438000 rw-p 00000000 00:00 0
38e4600000-38e460d000 r-xp 00000000 09:01 418113 /lib64/libgcc_s-4.1.2-20080825.so.1
38e460d000-38e480d000 ---p 0000d000 09:01 418113 /lib64/libgcc_s-4.1.2-20080825.so.1
38e480d000-38e480e000 rw-p 0000d000 09:01 418113 /lib64/libgcc_s-4.1.2-20080825.so.1
38e4a00000-38e4a15000 r-xp 00000000 09:01 418006 /lib64/libnsl-2.5.so
38e4a15000-38e4c14000 ---p 00015000 09:01 418006 /lib64/libnsl-2.5.so
38e4c14000-38e4c15000 r--p 00014000 09:01 418006 /lib64/libnsl-2.5.so
38e4c15000-38e4c16000 rw-p 00015000 09:01 418006 /lib64/libnsl-2.5.so
38e4c16000-38e4c18000 rw-p 00000000 00:00 0
38e4e00000-38e4f2d000 r-xp 00000000 09:01 418112 /lib64/libcrypto.so.0.9.8e
38e4f2d000-38e512c000 ---p 0012d000 09:01 418112 /lib64/libcrypto.so.0.9.8e
38e512c000-38e514d000 rw-p 0012c000 09:01 418112 /lib64/libcrypto.so.0.9.8e
38e514d000-38e5151000 rw-p 00000000 00:00 0
38e5600000-38e562c000 r-xp 00000000 09:01 125103 /usr/lib64/libgssapi_krb5.so.2.2
38e562c000-38e582c000 ---p 0002c000 09:01 125103 /usr/lib64/libgssapi_krb5.so.2.2
38e582c000-38e582e000 rw-p 0002c000 09:01 125103 /usr/lib64/libgssapi_krb5.so.2.2
38e5a00000-38e5a11000 r-xp 00000000 09:01 417846 /lib64/libresolv-2.5.so
38e5a11000-38e5c11000 ---p 00011000 09:01 417846 /lib64/libresolv-2.5.so
38e5c11000-38e5c12000 r--p 00011000 09:01 417846 /lib64/libresolv-2.5.so
38e5c12000-38e5c13000 rw-p 00012000 09:01 417846 /lib64/libresolv-2.5.so
38e5c13000-38e5c15000 rw-p 00000000 00:00 0
38e5e00000-38e5e02000 r-xp 00000000 09:01 418116 /lib64/libcom_err.so.2.1
38e5e02000-38e6001000 ---p 00002000 09:01 418116 /lib64/libcom_err.so.2.1
38e6001000-38e6002000 rw-p 00001000 09:01 418116 /lib64/libcom_err.so.2.1
38e6200000-38e6292000 r-xp 00000000 09:01 125191 /usr/lib64/libkrb5.so.3.3
38e6292000-38e6491000 ---p 00092000 09:01 125191 /usr/lib64/libkrb5.so.3.3
38e6491000-38e6495000 rw-p 00091000 09:01 125191 /usr/lib64/libkrb5.so.3.3
38e6600000-38e6608000 r-xp 00000000 09:01 125251 /usr/lib64/libkrb5support.so.0.1
38e6608000-38e6807000 ---p 00008000 09:01 125251 /usr/lib64/libkrb5support.so.0.1
38e6807000-38e6808000 rw-p 00007000 09:01 125251 /usr/lib64/libkrb5support.so.0.1
38e6a00000-38e6a02000 r-xp 00000000 09:01 418121 /lib64/libkeyutils-1.2.so
38e6a02000-38e6c01000 ---p 00002000 09:01 418121 /lib64/libkeyutils-1.2.so
38e6c01000-38e6c02000 rw-p 00001000 09:01 418121 /lib64/libkeyutils-1.2.so
38e6e00000-38e6e24000 r-xp 00000000 09:01 125174 /usr/lib64/libk5crypto.so.3.1
38e6e24000-38e7023000 ---p 00024000 09:01 125174 /usr/lib64/libk5crypto.so.3.1
38e7023000-38e7025000 rw-p 00023000 09:01 125174 /usr/lib64/libk5crypto.so.3.1
38e7200000-38e7246000 r-xp 00000000 09:01 418122 /lib64/libssl.so.0.9.8e
38e7246000-38e7446000 ---p 00046000 09:01 418122 /lib64/libssl.so.0.9.8e
38e7446000-38e744c000 rw-p 00046000 09:01 418122 /lib64/libssl.so.0.9.8e
3bdf800000-3bdf830000 r-xp 00000000 09:01 125065 /usr/lib64/libcurl.so.3.0.0
3bdf830000-3bdfa30000 ---p 00030000 09:01 125065 /usr/lib64/libcurl.so.3.0.0
3bdfa30000-3bdfa32000 rw-p 00030000 09:01 125065 /usr/lib64/libcurl.so.3.0.0
7fb64436c000-7fb6443ed000 rw-p 00000000 00:00 0
7fb6443ed000-7fb6a1fed000 rw-s 00000000 00:0f 519295928 /dev/shm/apc.shm.WVNr59 (deleted)
7fb6a1fed000-7fb6a1ff7000 r-xp 00000000 09:01 417797 /lib64/libnss_files-2.5.so
7fb6a1ff7000-7fb6a21f6000 ---p 0000a000 09:01 417797 /lib64/libnss_files-2.5.so
7fb6a21f6000-7fb6a21f7000 r--p 00009000 09:01 417797 /lib64/libnss_files-2.5.so
7fb6a21f7000-7fb6a21f8000 rw-p 0000a000 09:01 417797 /lib64/libnss_files-2.5.so
7fb6a21f8000-7fb6a222e000 r-xp 00000000 09:01 271691 /usr/lib64/extensions/no-debug-non-zts-20090626/redis.so
7fb6a222e000-7fb6a242d000 ---p 00036000 09:01 271691 /usr/lib64/extensions/no-debug-non-zts-20090626/redis.so
7fb6a242d000-7fb6a2430000 rw-p 00035000 09:01 271691 /usr/lib64/extensions/no-debug-non-zts-20090626/redis.so
7fb6a2430000-7fb6a243a000 r-xp 00000000 09:01 271692 /usr/lib64/extensions/no-debug-non-zts-20090626/phpiredis.so
7fb6a243a000-7fb6a263a000 ---p 0000a000 09:01 271692 /usr/lib64/extensions/no-debug-non-zts-20090626/phpiredis.so
7fb6a263a000-7fb6a263b000 rw-p 0000a000 09:01 271692 /usr/lib64/extensions/no-debug-non-zts-20090626/phpiredis.so
7fb6a263b000-7fb6a265b000 r-xp 00000000 09:01 271688 /usr/lib64/extensions/no-debug-non-zts-20090626/apc.so
7fb6a265b000-7fb6a285b000 ---p 00020000 09:01 271688 /usr/lib64/extensions/no-debug-non-zts-20090626/apc.so
7fb6a285b000-7fb6a285e000 rw-p 00020000 09:01 271688 /usr/lib64/extensions/no-debug-non-zts-20090626/apc.so
7fb6a285e000-7fb6a2867000 rw-p 00000000 00:00 0
7fb6a2867000-7fb6a286c000 r-xp 00000000 09:01 271689 /usr/lib64/extensions/no-debug-non-zts-20090626/xhprof.so
7fb6a286c000-7fb6a2a6c000 ---p 00005000 09:01 271689 /usr/lib64/extensions/no-debug-non-zts-20090626/xhprof.so
7fb6a2a6c000-7fb6a2a6d000 rw-p 00005000 09:01 271689 /usr/lib64/extensions/no-debug-non-zts-20090626/xhprof.so
7fb6a2a6d000-7fb6a2abc000 rw-p 00000000 00:00 0
7fb6a2afd000-7fb6a2b02000 rw-p 00000000 00:00 0
7fb6a2b02000-7fb6a2b18000 r-xp 00000000 09:01 418104 /lib64/libpthread-2.5.so
7fb6a2b18000-7fb6a2d17000 ---p 00016000 09:01 418104 /lib64/libpthread-2.5.so
7fb6a2d17000-7fb6a2d18000 r--p 00015000 09:01 418104 /lib64/libpthread-2.5.so
7fb6a2d18000-7fb6a2d19000 rw-p 00016000 09:01 418104 /lib64/libpthread-2.5.so
7fb6a2d19000-7fb6a2d1e000 rw-p 00000000 00:00 0
7fb6a2d1e000-7fb6a2d67000 r-xp 00000000 09:01 199252 /usr/local/mysql/lib/mysql/libmysqlclient.so.16.0.0
7fb6a2d67000-7fb6a2f66000 ---p 00049000 09:01 199252 /usr/local/mysql/lib/mysql/libmysqlclient.so.16.0.0
7fb6a2f66000-7fb6a2f94000 rw-p 00048000 09:01 199252 /usr/local/mysql/lib/mysql/libmysqlclient.so.16.0.0
7fb6a2f94000-7fb6a2f99000 rw-p 00000000 00:00 0
7fb6a2fa2000-7fb6a2fa4000 rw-p 00000000 00:00 0
7fff5bc9c000-7fff5bcbd000 rw-p 00000000 00:00 0 [stack]
7fff5bdff000-7fff5be00000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r--p 00000000 00:00 0 [vsyscall]
/bin/sh: line 1: 8478 Aborted php ./phpiredis.php
Thanks
Hey @nrk
With the new HHVM release 3.1.0 they've improved the stuff to make it 'easy' to port extensions to HHVM; https://github.com/facebook/hhvm/tree/master/hphp/runtime/ext_zend_compat
But they still have a list of "Bugs and Caveats" that to me sound like it's not really usable yet...
Unfortunatly I have zero experience with PHP extensions, but maybe it's time to invest some time into this.
Bofore I even begin, what do you think, the bugs they mention are show stoppers?
or is the best way forward to make a PHP implementation of a streaming parser for the Redis protocol that implements the same interface as the phpiredis classes as you mentioned in the HHVM ticket in async-predis?
first question : code
$multiple_servers = array('tcp://127.0.0.1:6388', 'tcp://127.0.0.1:6389');
$options=array('cluster' => 'redis');
$client = new Predis\Client($multiple_servers, $options);
$client->set('predis'.$i,$i);
$value = $client->get('predis'.$i);
echo $value ;
error:Can't inherit abstract function Predis\Cluster\StrategyInterface::getSlotByKey()
solution:ClusterStrategy.php note this ://abstract public function getSlotByKey($key); // abstract public function getDistributor(); and retry result is right
sencond question:when 127.0.0.1:6388 crash ,code will report error 。not use it slave 127.0.0.1:6386;
modify: $multiple_servers = array('tcp://127.0.0.1:6389', 'tcp://127.0.0.1:6388'); the code is right!
so the multiple_servers array first value can't crash !! this is a bug !!! hope correction it !!
Hiredis recently went to 0.14.1 and is working towards a 1.0.0 release with some breaking changes. With 0.14 be implemented? 1.0.0?
I am trying to install phpiredis and I get the following error.
What am i missing? its a new server setup.
PHP : /usr/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.5.4-1+debphp.org~raring+1
ZEND_VERSION: 2.5.0
PHP_OS : Linux - Linux ip-172-31-33-134 3.8.0-31-generic #46-Ubuntu SMP Tue Sep 10 20:03:44 UTC 2013 x86_64
INI actual : /home/ubuntu/installers/phpiredis/tmp-php.ini
More .INIs :
CWD : /home/ubuntu/installers/phpiredis
Extra dirs :
FAIL phpiredis connect [tests/001.phpt]
FAIL phpiredis command [tests/002.phpt]
FAIL phpiredis multicommand [tests/003.phpt]
FAIL phpiredis array [tests/004.phpt]
FAIL phpiredis multicommand [tests/005.phpt]
FAIL phpiredis command binary safe [tests/006.phpt]
FAIL phpiredis command binary safe using image [tests/007.phpt]
FAIL phpiredis reconnect on disconnect [tests/008.phpt]
FAIL phpiredis reconnect on disconnect [tests/009.phpt]
I cannot load the phpiredis module, as it fails to find libhiredis.so.0.10:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/phpiredis.so' - libhiredis.so.0.10: cannot open shared object file: No such file or directory in Unknown on line 0
However, libhiredis.so.0.10 is built and located here:
/usr/local/lib/libhiredis.so.0.10
I built phpiredis with the hiredis location specified here:
./configure --enable-phpiredis --with-hiredis-dir=/usr/local/lib
Is this phpiredis failing, or hiredis?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.