zeromq / php-zmq

ZeroMQ for PHP
http://pecl.php.net/zmq
Other
553 stars 119 forks source link

PHP 7.3 compatibility #193

Open remicollet opened 6 years ago

remicollet commented 6 years ago

Build can be fix with pr #190 but is not enough as we encounter segfault during test suite

=====================================================================
PHP         : /opt/remi/php73/root/usr/bin/php 
PHP_SAPI    : cli
PHP_VERSION : 7.3.0RC3
ZEND_VERSION: 3.3.0-dev
PHP_OS      : Linux - Linux builder.remirepo.net 4.18.10-100.fc27.x86_64 #1 SMP Wed Sep 26 11:06:22 UTC 2018 x86_64
INI actual  : /dev/shm/BUILD/php73-php-pecl-zmq-1.1.3/NTS
More .INIs  :   
CWD         : /dev/shm/BUILD/php73-php-pecl-zmq-1.1.3/NTS
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2018-10-12 05:42:34
=====================================================================
TEST 1/63 [tests/001-send.phpt]
========DIFF========
002+ 
002- string(12) "Hello world!"
003+ Termsig=11
========DONE========
FAIL Test send / recv [tests/001-send.phpt] 
TEST 2/63 [tests/002-test-binary.phpt]
========DIFF========
002+ zend_mm_heap corrupted
002- int(1580)
003- bool(true)
========DONE========
FAIL Test send / recv binary [tests/002-test-binary.phpt] 
PASS Test getting persistent id [tests/003-getpersistentid.phpt] 
PASS Test getting endpoints [tests/004-getendpoints.phpt] 
PASS Test forcing connect [tests/005-forceconnectarg.phpt] 
PASS Test getsockopt / setsockopt [tests/006-sockopt.phpt] 
TEST 7/63 [tests/007-addremovepoll.phpt]
========DIFF========
004+ 
005+ Termsig=11
004- array(1) {
005-   [0]=>
006-   resource(%d) of type (stream)
007- }
008- array(1) {
009-   [0]=>
010-   resource(%d) of type (stream)
011- }
012- int(1)
013- array(1) {
014-   [0]=>
015-   string(3) "r:%d"
016- }
017- int(0)
========DONE========
FAIL Test adding / removing items [tests/007-addremovepoll.phpt] 
PASS Test constructing a socket [tests/008-twowaystoconstruct.phpt] 
PASS Test ispersistent on context and socket [tests/009-ispersistent.phpt] 
PASS Test invalid args for ZMQPoll [tests/010-pollsetinvalidargs.phpt] 
PASS Test exceptions [tests/011-exceptions.phpt] 
PASS Test remove invalid id from ZMQPoll [tests/012-pollsetremoveinvalid.phpt] 
PASS Test clearing and reusing ZMQPoll [tests/013-pollclearandreuse.phpt] 
PASS Test setSockOpt param type [tests/014-setsockoptparam.phpt] 
PASS Test basic callback usage [tests/015-callback.phpt] 
PASS Test invalid args for callback [tests/016-callbackinvalidargs.phpt] 
PASS Test that callback is only called on new socket [tests/017-callbackonlyonnewsocket.phpt] 
PASS Test callback arguments on persistent and non-persistent socket [tests/018-callbackpersistent.phpt] 
PASS Test throwing exception from callback [tests/020-exceptionincallback.phpt] 
TEST 20/63 [tests/021-callbackwarning.phpt]
========DIFF========
001+ Warning: in_array() expects parameter 2 to be array, int given in /dev/shm/BUILD/php73-php-pecl-zmq-1.1.3/NTS/tests/021-callbackwarning.php on line 5
001- Warning: in_array() expects parameter 2 to be array, integer given in %s on line %d
========DONE========
FAIL Test warning in callback [tests/021-callbackwarning.phpt] 
TEST 21/63 [tests/022-highwatermark.phpt]
========DIFF========
001+ 
001- array(1) {
002-   [0]=>
003-   object(ZMQSocket)#3 (0) {
004-   }
005- }
006- array(0) {
007- }
008- array(1) {
009-   [0]=>
010-   object(ZMQSocket)#3 (0) {
011-   }
012- }
013- OK
========DONE========
FAIL Test that high-watermark works [tests/022-highwatermark.phpt] 
PASS Test that failing callback does not add socket to plist [tests/023-failedcallback.phpt] 
PASS Test retrieving version [tests/024-versionconstant.phpt] 
PASS Test send / recv for multipart messages [tests/025-sendrecvmulti.phpt] 
PASS Test returning socket type [tests/026-sockettype.phpt] 
PASS Test setting and getting values [tests/027-getset.phpt] 
TEST 27/63 [tests/028-xpub.phpt]
========DIFF========
001+ Termsig=11
001- string(3) "Hel"
002- string(12) "Hello world!"
========DONE========
FAIL Test send / recv with XPUB and XSUB sockets [tests/028-xpub.phpt] 
TEST 28/63 [tests/029-xrepxreqdevice.phpt]
========DIFF========
002+ zend_mm_heap corrupted
002- string(13) "Hello client!"
========DONE========
FAIL Test send / recv with an XREQ and XREP device [tests/029-xrepxreqdevice.phpt] 
SKIP Test send / recv with a manually created XREQ and XREP device [tests/030-xrepmanualqueue.phpt] reason: Only for in libzmq 3.3.0
PASS Test last endpoint [tests/031-lastendpoint.phpt] 
PASS Test context options [tests/032-contextopt.phpt] 
PASS Test disconnect [tests/033-disconnect.phpt] 
PASS Test unbind [tests/034-unbind.phpt] 
TEST 34/63 [tests/035-capture.phpt]
========DIFF========
003+ zend_mm_heap corrupted
003- Receiving from capture listener
004- string(13) "Hello backend"
005- OK
========DONE========
FAIL Test device capture [tests/035-capture.phpt] 
PASS Test device callbacks [tests/036-device.phpt] 
PASS Test device deprecated args [tests/037-device-deprecated.phpt] 
SKIP Test a ZMQCert can be constructed. [tests/038-cert-construct.phpt] reason: This test requires php-zmq to be compiled with --with-czmq (only CZMQ 2.x supported)
SKIP Test two ZMQCerts can be tested for equality. [tests/039-cert-equals.phpt] reason: This test requires php-zmq to be compiled with --with-czmq (only CZMQ 2.x supported)
SKIP Test a ZMQCert can be cloned. [tests/040-cert-clone.phpt] reason: This test requires php-zmq to be compiled with --with-czmq (only CZMQ 2.x supported)
SKIP Test a ZMQCert can get and set metadata. [tests/041-cert-meta.phpt] reason: This test requires php-zmq to be compiled with --with-czmq (only CZMQ 2.x supported)
SKIP Test a ZMQCert can be saved. [tests/042-cert-save.phpt] reason: This test requires php-zmq to be compiled with --with-czmq (only CZMQ 2.x supported)
SKIP Test a ZMQCert can be loaded. [tests/043-cert-load.phpt] reason: This test requires php-zmq to be compiled with --with-czmq (only CZMQ 2.x supported)
SKIP Test a ZMQAuth can be constructed. [tests/044-auth-construct.phpt] reason: This test requires php-zmq to be compiled with --with-czmq (only CZMQ 2.x supported)
SKIP Test a ZMQAuth can whitelist or blacklist an IP address. [tests/045-auth-allow-deny.phpt] reason: This test requires php-zmq to be compiled with --with-czmq (only CZMQ 2.x supported)
SKIP Test a ZMQCert can be applied to a ZMQSocket. [tests/046-cert-apply.phpt] reason: This test requires php-zmq to be compiled with --with-czmq (only CZMQ 2.x supported)
SKIP Test a ZMQAuth can be configured. [tests/047-auth-configure.phpt] reason: This test requires php-zmq to be compiled with --with-czmq (only CZMQ 2.x supported)
PASS Test pollset items [tests/048-pollsetitems.phpt] 
TEST 48/63 [tests/049-events.phpt]
========DIFF========
010+ zend_mm_heap corrupted
010- array(3) {
011-   ["event"]=>
012-   int(1)
013-   ["value"]=>
014-   int(%d)
015-   ["address"]=>
016-   string(20) "tcp://127.0.0.1:5050"
017- }
018- bool(true)
019- OK
========DONE========
FAIL Test events [tests/049-events.phpt] 
TEST 49/63 [tests/050-sharedcontext.phpt]
========DIFF========
002+ zend_mm_heap corrupted
002- bool(true)
003- int(2)
004- OK
========DONE========
FAIL Test shared context [tests/050-sharedcontext.phpt] 
PASS Test socket count variations [tests/051-socketcount.phpt] 
SKIP Test pthreads integration [tests/052-pthreads.phpt] reason: Requires pthreads extension
PASS Test z85 [tests/053-z85.phpt] 
PASS Test curve keypair [tests/054-curvekeypair.phpt] 
PASS Test for GitHub issue 156 (https://github.com/mkoppanen/php-zmq/issues/156) [tests/bug_gh_156.phpt] 
PASS Test for Github issue #165 [tests/bug_gh_165.phpt] 
PASS Test for Github issue #43 [tests/bug_gh_43.phpt] 
TEST 57/63 [tests/bug_gh_49.phpt]
========DIFF========
001+ Termsig=11
001- client to server msg:0
002- server to client msg:1
003- client to server msg:2
004- server to client msg:3
005- client to server msg:4
006- server to client msg:5
007- client to server msg:6
008- server to client msg:7
009- client to server msg:8
010- server to client msg:9
========DONE========
FAIL Test for Github issue #49 [tests/bug_gh_49.phpt] 
TEST 58/63 [tests/bug_gh_50.phpt]
========DIFF========
001+ Termsig=11
001- bool(true)
002- array(2) {
003-   [0]=>
004-   object(ZMQSocket)#3 (0) {
005-   }
006-   [1]=>
007-   object(ZMQSocket)#4 (0) {
008-   }
009- }
010- array(0) {
011- }
012- bool(true)
013- array(1) {
014-   [0]=>
015-   object(ZMQSocket)#3 (0) {
016-   }
017- }
018- array(0) {
019- }
========DONE========
FAIL Test for Github issue #50 [tests/bug_gh_50.phpt] 
PASS Test for Github issue #59 [tests/bug_gh_59.phpt] 
PASS Test for Github issue #59 [tests/bug_gh_59_2.phpt] 
SKIP Test setting socket options [tests/libzmq2-sockopt.phpt] reason: This test is for PHP7 and libzmq version 2.x
SKIP Test setting socket options [tests/libzmq3-sockopt.phpt] reason: This test is for PHP7 and libzmq version 3.x
PASS Test setting socket options [tests/libzmq4-sockopt.phpt] 
=====================================================================
TIME END 2018-10-12 05:42:41

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   15
---------------------------------------------------------------------

Number of tests :   63                49
Tests skipped   :   14 ( 22.2%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   12 ( 19.0%) ( 24.5%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :   37 ( 58.7%) ( 75.5%)
---------------------------------------------------------------------
Time taken      :    7 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Test send / recv [tests/001-send.phpt]
Test send / recv binary [tests/002-test-binary.phpt]
Test adding / removing items [tests/007-addremovepoll.phpt]
Test warning in callback [tests/021-callbackwarning.phpt]
Test that high-watermark works [tests/022-highwatermark.phpt]
Test send / recv with XPUB and XSUB sockets [tests/028-xpub.phpt]
Test send / recv with an XREQ and XREP device [tests/029-xrepxreqdevice.phpt]
Test device capture [tests/035-capture.phpt]
Test events [tests/049-events.phpt]
Test shared context [tests/050-sharedcontext.phpt]
Test for Github issue #49 [tests/bug_gh_49.phpt]
Test for Github issue #50 [tests/bug_gh_50.phpt]
=====================================================================
nop1984 commented 3 years ago

@Lukaum dont know to whom this question was addressed, but if to me - I went onto Workerman + websockets to implement push notifications broker

Lukaum commented 3 years ago

@nop1984 Great answer!

I read every topic about change or similar lib for the zmq in ratchet, for this push purpose. But don't had a clear answer (until at this moment).

Tried the Swoole php (in virtual machine with centos8), but its hard to implement and use (principally in windows so).

Think this wokerman its a best solution. Gonna use!

nop1984 commented 3 years ago

@Lukaum Swoole must be the fastest for PHP, but I don't need great speed much + wish to avoid installing extra php-ext because this for public drupal module. Workerman is also fast + it is very basic and simple, easy to start. But things got complex when trying not to duplicate logic in each callback, so it took me near week to imagine a model and write a helper where basically I describe the operation as an array of callbacks, kinds "chain" or "tree" and run it. So with it I can write almost classic OOP with fine logic, except functions more divided into smaller, join then all in 1 function into the "chain" array, also provide $this context and agrs in same array, and run that 'chain' array, with state sync inside class properties.

Lukaum commented 3 years ago

@nop1984 In my case, i just need to use websocket for a "real time" notifications, and only send this data for employees (in admin panel).

For ratchet i found a solution. It works well when data comes from client-side, but i have a webhook comes from a payment gateway to my server, so thats why i need the push (update some row in db and transmit for some websocket connections, thats is the problem without the zmq).

nop1984 commented 3 years ago

@Lukaum seems almost same I do: realtime push notification for client and support crew, via inpage js (toasts) and via browser Notification API with "webhooks" to update message status on backend (if it was delivered, if was interacted by user). With redis based middleware storage for better speed (not to call "webhooks" and other things per event but per timer). But without ZMQ, just workerman + redis on server and js ServiceWorker & page script on client.

zhiyong-ft commented 2 years ago

Just to share my experience, I was unable to get php-7.4.4-zmq-1.1.4-4.3.2-x64-vc15-zts-nts.zip from the following link to work.

https://github.com/zeromq/php-zmq/issues/193#issuecomment-605456811

Tried to rename or not rename those dll files, or put libzmq.dll into apache/bin folder, always get:

PHP Warning:  PHP Startup: Unable to load dynamic library 'php_zmq.dll' (tried: D:\xampp\php\ext\php_zmq.dll (The specified module could not be found.), D:\xampp\php\ext\php_php_zmq.dll.dll (The specified module could not be found.)) in Unknown on line 0

I am running XAMP with PHP 7.4.23 X64 on Windows 11. On the same machine, XAMPP with PHP 7.2.34 works fine with PHP-ZMQ,

paulocesarborges commented 1 year ago

Guys, can anyone share a php_zmq to PHP8.2 or 8.1 NTS?? Please!! Or at least give instructions in how to compile! Thank you

paulocesarborges commented 1 year ago

Just Did it guys, feel free to test

zmq-php-8.2.10-NTS.zip

andypost commented 1 year ago

It also builds and passing tests on PHP 8.3

sergiorighi commented 1 year ago

Paulo, do you have a TS version? Obrigado.

paulocesarborges commented 1 year ago

the TS version you can find here: https://github.com/stijnvdb88/php-zmq/releases/tag/v4.3.4

paulocesarborges commented 1 year ago

I made a new ZIP with the instructions and the correct files to everyone! Now its everting working

ZMQ-4.3.4_x64_PHP8.2.10-NTS.zip

:D