环境声明:
swoole
Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.4.7-alpha
PHP Version => 7.3.10
然后我按照官方文档上的说明安装ext-async扩展,但是他总是说我函数错误。
操作如下:
git clone https://github.com/swoole/ext-async.git
cd ext-async
./configure --with-php-config=/home/phps/php/bin/php-config
make
然后就出错了
错误如下:
/tmp/ext-async/swoole_http_client.cc: In function ‘void zim_swoole_http_client_push(zend_execute_data*, zval*)’:
/tmp/ext-async/swoole_http_client.cc:2243:77: error: ‘swWebSocket_set_flags’ was not declared in this scope
uint8_t flags = swWebSocket_set_flags(fin, http->websocket_mask, 0, 0, 0);
^
/tmp/ext-async/swoole_http_client.cc:2244:81: error: too few arguments to function ‘int php_swoole_websocket_frame_pack(swString*, zval*, zend_bool, zend_bool, zend_bool)’
if (php_swoole_websocket_frame_pack(http_client_buffer, zdata, opcode, flags) < 0)
^
In file included from /tmp/ext-async/php_swoole_async.h:26:0,
from /tmp/ext-async/swoole_http_client.cc:18:
/home/phps/php/include/php/ext/swoole/php_swoole.h:373:5: note: declared here
int php_swoole_websocket_frame_pack(swString *buffer, zval *zdata, zend_bool opcode, zend_bool fin, zend_bool mask);
升级swoole到正式版本,再安装async,版本对齐。试试