环境声明:

swoole

Swoole => enabled

Author => Swoole Team

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,版本对齐。试试

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐