I have found a compatibility bug at \PhpAmqpLib\Wire\IO\StreamIO.php line 88:
self::$ERRNO_EQUALS_EAGAIN = 'errno=' . SOCKET_EAGAIN;
I checked the PHP source code, the SOCKET_EAGAIN constant is referred from EAGAIN, but cannot be accessed in Windows (EWOULDBLOCK instead in Windows). Thus the program would crash due to this undefined constant. Please kindly check whether defined SOCKET_EAGAIN before use it, or replace it by SOCKET_EWOULDBLOCK, also it's an alias for SOCKET_EAGAIN in Linux.
// patch type1:
self::$ERRNO_EQUALS_EAGAIN = 'errno=' . (defined('SOCKET_EAGAIN') ? SOCKET_EAGAIN : SOCKET_EWOULDBLOCK);
// patch type2:
self::$ERRNO_EQUALS_EAGAIN = 'errno=' . SOCKET_EWOULDBLOCK;
If you have time, a pull request would be appreciated. Thanks!
When I hardcode the value for this, it is working for me
self::$ERRNO_EQUALS_EAGAIN = 'errno=' . SOCKET_EAGAIN;
self::$ERRNO_EQUALS_EWOULDBLOCK = 'errno=' . SOCKET_EWOULDBLOCK;
self::$ERRNO_EQUALS_EINTR = 'errno=' . SOCKET_EINTR;
I fixed this issue by enabling the socket ext in php
@nifrasismail
How did you enable socket ext ?
from your php.ini uncomment this
;extension=php_sockets.dll
P.S if you are using docker install the extension on your Dockerfile
RUN docker-php-ext-install sockets
Most helpful comment
from your
php.iniuncomment thisP.S if you are using docker install the extension on your Dockerfile